please explain: | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 1

please explain:

Traceback (most recent call last): File "..\Playground\", line 2, in <module> assert (temp >= 0), "Colder than absolute zero!"

3rd Aug 2018, 10:10 PM
Divya Nandakumar
Divya Nandakumar - avatar
4 Réponses
+ 4
can you please show us the code so we can help you better
3rd Aug 2018, 10:14 PM
LONGTIE👔
LONGTIE👔 - avatar
+ 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
3rd Aug 2018, 10:16 PM
JME
+ 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!
3rd Aug 2018, 10:16 PM
Divya Nandakumar
Divya Nandakumar - avatar