. And Now, For Something Completely Familiar


#1

print "my_string=cat"
print len("my_string")
print "my_string.upper()"

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.


#2

On line 3, create the variable my_string and set it to any string you'd like.

    my_string = "cat"

On line 4, print the length of my_string.

    print len(my_string)

On line 5, print the .upper() case version of my_string.

    print my_string.upper()

Notice the only place we use quotes is on the string primitive itself, and nowhere else.


#3

I am inputting
my_string = "cat"
print len(my_string)
pring my_string.upper()

and getting the error that I haven't created a variable called my_string. What am I doing wrong?


#4

Simple typing error; should read,

print my_string.upper()