stage.set_background("schoolhallway")
sprite = codesters.Sprite("person8")
stage.set_gravity(4)
stage.disable_floor()
sprite.set_gravity_off()
sprite.go_to(0, -220)
try:
tval1 = score
except:
tval1 = "DNE"
t1 = TestObjective()
t1.add_success(tval1 == 0, "Great job!")
t1.add_failure(tval1 == "DNE", "Did you add an integer variable and name it score?")
t1.add_failure(tval1 == 25, "Did you change the value of score to 0?")
t1.add_failure(type(tval1) is str, "Oops! Make sure you don't put quotes around your integer value 0!")
t1.add_failure(tval1 > 0 and tval1 != 25, "Let's start the game with a score of 0!")
t1.add_failure(tval1 < 0, "Let's start the game with a score of 0!")
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)