On topic 16 my_string is not creating..... What to do?


#1



Replace this line with your code.


#2

can you post your code?


#3

On line 3, create the variable my_string and set it to any string you'd like.
On line 4, print the length of my_string.
On line 5, print the .upper() case version of my_string.

and i did

my_string= "Hey this is a string"
print len(my_string)
print my_string.upper()


#4

That looks all good.. In the console, do you see the length of your string and string in upper case? May be try refreshing the whole page and check?


#5

ok....thanx for the help.... :smiley:


#6

Your welcome :slight_smile: does it work, btw?


#7

Can anyone explain why the number 20 is there? I got it to work but i expected the console to spit out.

Hey this is a string
HEY THIS IS A STRING
none


#8

20 is there because it was asked to print the length of the string (20 characters) in line 4.
If you wanted it to print the normal string first change it to: print my_string
Hope that helps