stage.set_background("underwater")
score = 0
score_board = codesters.Display(score)
weak_pws = ["password", "password123", "hello1", "snuffles", "123456"]
strong_pws = ["cat", "dog", "pig"]
try:
tval1 = sorted(strong_pws)
except:
tval1 = "DNE"
t1 = TestObjective()
t1.add_success( tval1 == ['007jmSB0nd!', '108turt!es762', '@Mjrc0olguy!', 'Avv3SoMe!305', 'GgbvTa581!@'], "Great job!")
t1.add_failure(tval1 == "DNE", "Oops! Did you delete your strong_pws list?")
t1.add_failure(tval1 == ['cat', 'dog', 'pig'], "Did you change the values in your strong_pws list?")
t1.add_failure( '@Mjrc0olguy!' not in tval1, 'Make sure your strong password list includes "@Mjrc0olguy!"!')
t1.add_failure('007jmSB0nd!' not in tval1, 'Make sure your strong password list includes "007jmSB0nd!"!')
t1.add_failure('GgbvTa581!@'not in tval1, 'Make sure your strong password list includes "GgbvTa581!@"!')
t1.add_failure('108turt!es762' not in tval1, 'Make sure your strong password list includes "108turt!es762"!')
t1.add_failure('Avv3SoMe!305' not in tval1, 'Make sure your strong password list includes "Avv3SoMe!305"!')
t1.add_failure(len(tval1) < 5, "Oops! Did you add all the strings to the list and seperate the values with a comma?")
tester = TestManager()
tester.add_test_list([t1])
tester.run_tests()
tester.display_first_feedback()
-
Run Code
-
Activity Submitted!
提交作品
-
下个活动
-
Stop Running Code
-
Show Chart
-
Show Console
-
Reset Code Editor
-
Codesters How To (opens in a new tab)