2018-06-01 10:21:46 -04:00
|
|
|
# tests for things that only Python 3.6 supports, needing floats
|
|
|
|
|
|
|
|
# underscores in numeric literals
|
|
|
|
print(1_000.1_8)
|
2021-03-15 09:57:36 -04:00
|
|
|
print("%.2g" % 1e1_2)
|
2018-06-01 10:21:46 -04:00
|
|
|
|
|
|
|
# underscore supported by int/float constructors
|
2021-03-15 09:57:36 -04:00
|
|
|
print(float("1_2_3"))
|
|
|
|
print(float("1_2_3.4"))
|
|
|
|
print("%.2g" % float("1e1_3"))
|