+ 2

Here,how this program prints the output as 1111.0 ??what about underscore?

a='11_11' print(float(a)) Even the 'infinity' is printed as inf why?

25th Jul 2020, 3:16 PM
Shreepriya HA
3 odpowiedzi
+ 11
The underscore is a possibility to group numbers for better readability. It can be used in a string representation or in an int value. a='11_11' print(float(a)) print(10_000)
25th Jul 2020, 3:22 PM
Lothar
Lothar - avatar
+ 5
New feature from version 3.6 https://staging.python.org/dev/peps/pep-0515/
25th Jul 2020, 3:22 PM
Ipang
+ 3
Thanks i understood
25th Jul 2020, 3:35 PM
Shreepriya HA