stage.set_background("winter")
sprite = codesters.Sprite("person12")
sprite.go_to(-125, -150)
frosty = codesters.Sprite("snowman")
frosty.go_to(100, -125)
snow = codesters.Sprite("snowflake3")
snow.go_to(100, 75)
greeting = codesters.Text("Happy Holidays!")
greeting.go_to(0, 200)
t = codesters.Teacher()
try:
tval1 = t.find_function('set_color')[0][1]
except:
tval1 = "DNE"
t1 = TestObjective()
t1.add_success("yellow" in tval1 and 'greeting' in tval1, "Great Job!")
t1.add_failure(tval1 == "DNE", "Did you add a Set Color command?")
t1.add_failure('sprite' in tval1, "Did you change the name in front of the Set Color command to greeting?")
t1.add_failure("green" in tval1, "Did you change the color name in the Set Color command?")
t1.add_creative("yellow" not in tval1 and tval1 != "DNE" and "green" not in tval1, "That's a good color as well!")
tester = TestManager()
tester.add_test_list([t1])
tester.run_tests()
tester.display_first_feedback()
-
Run Code
-
Activity Submitted!
Enviar Trabajo
-
Actividad Siguiente
-
Stop Running Code
-
Show Chart
-
Show Console
-
Reset Code Editor
-
Codesters How To (opens in a new tab)