I just started learning python a few days ago and I came across the str.isdecimal()
function. I get an error when I type the following into a python environment:
text="123"
Print text.isdecimal()
The error is: 'str' object has no attribute 'isdecimal'.
However, when I type the following:
text=u"123"
Print text.isdecimal()
Then things work out fine and I get "True" in return as expected.
My question
What is happening here? Specifically, what is the u doing to the string definition and why wont the isdecimal function work otherwise?
Thank you and sorry for if the question is too elementary.