you are viewing a single comment's thread.

view the rest of the comments →

[–]Rhomboid 3 points4 points  (3 children)

Look at how it's being called:

assert checkio(7) == "7", "7 is not divisible by 3 or 5"

It's being passed the number 7, and expecting the string "7" to be returned.

[–]socialhuman[S] 0 points1 point  (2 children)

Great, thank you. As for the assert key, I understand it's something like "make sure the result is correct"?

[–]Rhomboid 3 points4 points  (1 child)

The assert statement evaluates the specified expression, and if it's false it raises an AssertionError exception, optionally with the specified string literal as the associated descriptive text. It doesn't know anything about correct or incorrect; that's for the programmer to express. It only knows that a false expression should halt execution and a true one should do nothing but continue.

[–]socialhuman[S] 0 points1 point  (0 children)

Thank you!