# sprite = codesters.Rectangle(x, y, width, height, "color")
start = codesters.Rectangle(0, -250, 500, 50, "red")
# sprite = codesters.Rectangle(x, y, width, height, "color")
finish = codesters.Rectangle(0, 250, 500, 50, "green")
my_list = [-150, -50, 50, 150]
for value in my_list:
pass # delete after adding indented code
# add code here
t = codesters.Teacher()
rects = t.find_function("Rectangle")
try:
tval1 = rects[2][1].lower().replace(' ','')
tval1_indent = t.get_indent_at_line(rects[2][0])
except:
tval1 = "DNE"
tval1_indent = "DNE"
t1 = TestObjective()
t1.add_success('rectangle(0,value,100,50,"blue")' in tval1 and tval1_indent == 4, "Great Job!")
t1.add_failure(tval1 == "DNE", "Did you add a new rectangle sprite inside the loop?")
t1.add_failure(tval1 != "DNE" and '(0,value,' not in tval1, "Did you change the y argument for the rectangle from 0 to value?")
t1.add_failure('rectangle(0,value,100,50,"blue")' in tval1 and tval1_indent != 4, "Did you place the new rectangle indented inside the loop?")
tester = TestManager()
tester.add_test_list([t1])
tester.run_tests()
tester.display_first_feedback()
-
Run Code
-
Activity Submitted!
Submit Work
-
Next Activity
-
Stop Running Code
-
Show Chart
-
Show Console
-
Reset Code Editor
-
Codesters How To (opens in a new tab)