6ded55a61f
"1/0" is sacred idiom, the shortest way to break program execution (sys.exit() is too long).
17 lines
217 B
Python
17 lines
217 B
Python
# basic float
|
|
x = 1 / 2
|
|
print(x)
|
|
|
|
print(1.0 // 2)
|
|
print(2.0 // 2)
|
|
|
|
try:
|
|
1.0 / 0
|
|
except ZeroDivisionError:
|
|
print("ZeroDivisionError")
|
|
|
|
try:
|
|
1.0 // 0
|
|
except ZeroDivisionError:
|
|
print("ZeroDivisionError")
|