Question: 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)
 solve in python only, all the test cases should pass. AI

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!