# sprite = codesters.Star(x, y, points, radius, "color")
sprite = codesters.Star(0, 0, 7, "100", plum)
t = codesters.Teacher()
try:
tval1 = sprite.get_color()
except:
tval1 = "DNE"
try:
params = t.get_parameters_for_function('Star')
tval2 = 0
for sublist in params:
tval2 += sublist.count('"100"')
except:
tval2 = "DNE"
tester = TestManager()
t1 = TestObjective()
t1.add_success(tval1 == "plum", "Great job debugging the program!")
t1.add_failure(tval1 == "DNE", "Did you delete the star?")
t1.add_creative(tval1 != "plum" and tval1 != "DNE", "That's a good color too!")
t2 = TestObjective()
t2.add_success(tval2 == 0, "Great job debugging the program!")
t2.add_failure(tval2 == 1, "Did you use an integer for the radius parameter?")
t2.add_failure(tval2 == "DNE", "Did you delete the star?")
tester.add_test_list([t1, t2])
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)