Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

solve in python only, all the test cases should pass. AI is giving wrong answers!!!!!! here are the test cases: testcase 1 : text =

solve in python only, all the test cases should pass. AI is giving wrong answers!!!!!!
here are the test cases:
testcase1:
text =(
"
lol some text I guess
"
"here is the first paragraph
"
"
here is the second one
"
"some words here in the third one
"
"this is the last line
"
)
assert move_cursor((1,0), text, "2}")==(7,0)
assert move_cursor((1,0), text, "2}3W")==(8,12)
assert move_cursor((1,0), text, "2}3WG")==(9,12)
testcase2:
text =(
"
lol some text I guess
"
"here is the first paragraph
"
"
here is the second one
"
"some words here in the third one
"
"this is the last line
"
)
try:
move_cursor((1,1), text, "2}3WG")
except ValueError:
# first line is empty, there's no (1,1)
pass
assert move_cursor((1,0), text, "2}")== move_cursor((1,0), text, "}}")
testcase3:
text =(
"
lol some text I guess
"
"here is the first paragraph
"
"
here is the second one
"
"some words here in the third one
"
"this is the last line
"
)
assert (
move_cursor((3,1), text, "hhhhhhhhhhhhhhhhhhhhhhhhhhh")
== move_cursor((3,1), text, "30h")
==(3,27)
)
testcase4:
text =(
"
lol some text I guess
"
"here is the first paragraph
"
"
here is the second one
"
"some words here in the third one
"
"this is the last line
"
)
assert move_cursor((1,0), text, "10W")==(3,19)
assert move_cursor((1,0), text, "10W10B")==(1,0)
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases On The Web Designing And Programming For Network Access

Authors: Patricia Ju

1st Edition

1558515100, 978-1558515109

More Books

Students also viewed these Databases questions

Question

=+ (c) From (18.10) deduce T(4) = VIT.

Answered: 1 week ago