2013-12-29 22:34:42 +00:00
|
|
|
# basic float
|
|
|
|
x = 1 / 2
|
|
|
|
print(x)
|
2014-03-31 00:20:00 +01:00
|
|
|
|
|
|
|
print(1.0 // 2)
|
|
|
|
print(2.0 // 2)
|
|
|
|
|
|
|
|
try:
|
|
|
|
1.0 / 0
|
|
|
|
except ZeroDivisionError:
|
|
|
|
print("ZeroDivisionError")
|
|
|
|
|
|
|
|
try:
|
|
|
|
1.0 // 0
|
|
|
|
except ZeroDivisionError:
|
|
|
|
print("ZeroDivisionError")
|