Can't execute len of float converted to str


#1

I did some experimental with topic 8 STR ()
I can get printed output for

pi = 3.14
str(pi)
print pi

So i try to excute

pi = 3.14
str(pi)
print len(pi)

But i get object of type 'float' has no len() when expected 4
`


#2

your variable pi still refers to a float, because you did not assign a new value to it


#3

So we can't measure lenght of float/int? good lesson :wink: thanks!


#4

Would you really want to?

How long is 5?