Strings & Console Output 16/16



my_string = "hi there"
print "my_string"
print my_variable.upper()


print my_variable.upper()
change above statement as follows

print my_string.upper()


line 1
my_string= "hi there" #You have created a variable that is equal to the string "hi there" Awesome!

line 2
print "my_string" #You don't need those quotes around your variable! Quotes make strings. Take those out. Remember! We are looking for the length of my_string. We want the computer to do our boring work. How can we use the len() method to do this?
print len(my_string) ----> prints the length of the variable my_string (You made that!)

line 3
print my_variable.upper() #So close! You created the variable my_string (line 1)! Technically is is YOUR variable but it prefers to be called my_string (You named it that!)

try calling the variable by the name you gave it and run it.

Hope this helps!


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.