- 2

help me plz

not working my_string = 'lol' print len('my_string') print my_string.upper()

22nd Jan 2017, 2:58 PM
code-junkie
code-junkie - avatar
5 Answers
+ 5
my_string = 'lol' print(len(my_string)) print(my_string.upper())
22nd Jan 2017, 3:01 PM
Valen.H. ~
Valen.H. ~ - avatar
+ 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())
22nd Jan 2017, 3:03 PM
visph
visph - avatar
+ 1
I've already explain: what don't you understand?
22nd Jan 2017, 3:27 PM
visph
visph - avatar
- 2
thx can anyone explain it to me so i understand
22nd Jan 2017, 3:25 PM
code-junkie
code-junkie - avatar
- 2
sorry i understand now
22nd Jan 2017, 3:35 PM
code-junkie
code-junkie - avatar