+ 3
Anyone can explain print(len(str(float)))
5 Respuestas
+ 6
It takes the name of the float class
<class 'float'>
Converts to a str value and then prints the length of that string. Which if you count all the characters including the space is 15.
Try;
print(float)
to understand better
+ 6
Thank u @ChaoticDawg and try it print(float)
+ 3
Hari Haran
I answered that in my previous post.
Run
print(float)
Then count the number of characters that are output including the space. It will equal 15.
+ 1
Print the length of the string value of a float number
1.342 would be 4
edit:
its 5, len takes '.' into account
+ 1
@ChaoticDawg How the answer is 15?