+ 1
please explain:
Traceback (most recent call last): File "..\Playground\", line 2, in <module> assert (temp >= 0), "Colder than absolute zero!"
4 Respuestas
+ 4
can you please show us the code so we can help you better
+ 2
if the assert statement evaluates to false it throws an Assertion Error followed by what's after the comma. if the statement is true it continues on as normal
+ 1
code:
temp = -10
assert (temp >= 0), "Colder than absolute zero!"
output:
Traceback (most recent call last):
File "..\Playground\", line 2, in <module>
assert (temp >= 0), "Colder than absolute zero!"
AssertionError: Colder than absolute zero!