Assertions
print(1)
assert 2 + 2 == 4
print(2)
assert 1 + 1 == 3
print(3)1
2
Traceback (most recent call last):
File "/Users/nuhil/Desktop/Test.py", line 4, in <module>
assert 1 + 1 == 3
AssertionErrordef KelvinToFahrenheit(Temperature):
assert (Temperature >= 0),"Colder than absolute zero!"
return ((Temperature-273)*1.8)+32
print(KelvinToFahrenheit(273))
print(int(KelvinToFahrenheit(505.78)))
print(KelvinToFahrenheit(-5))Last updated