- 2
help me plz
not working my_string = 'lol' print len('my_string') print my_string.upper()
5 odpowiedzi
+ 5
my_string = 'lol'
print(len(my_string))
print(my_string.upper())
+ 2
If you use Python 3.x, you must use parenthesis for the fuction print() ( was statement in < 3.x versions, but now it's a function ), and delete the quotes embeding your variable name, else it is interpreted as a string, so the len() function will return 9, the length of the sting 'my_string' ^^:
my_string = 'lol'
print(len(my_string))
print(my_string.upper())
+ 1
I've already explain: what don't you understand?
- 2
thx can anyone explain it to me so i understand
- 2
sorry i understand now