And Now, For Something Completely Familiar


Write your code below, starting on line 3!

print len(x)
print x.upper()

Oops, try again. Did you create a variable called my_string?

Where am I going wrong?

Replace this line with your code.


you created a variable called x and gave it a value of 'my_string'


If I reverse it, it says I cant assign to literal.


but my_string should be the variable (without apostrophes, otherwise it would be a string), and you should give it a string value


Write your code below, starting on line 3!

print len(my_string)
print my_string.upper()

comes back with

Traceback (most recent call last):
File "python", line 3, in
NameError: name 'my_string' is not defined


to name a variable you need to do:

variable_name = 'value'

you need to give it a value, in this case a string and a variable named my_string


thank you so much! I appreciate the help!