Help Me, Strings & Console Output PYTHON


#1




Oops, try again. Did you remember to print len(my_string)?


Let's wrap it all up!

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.


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


#2

@voltzenhd ,

Does this line print anything? ...

len(my_string)

#3

Gold, I defined it on top


#4

No, you called the len function, but did not print the result of calling it. That's why Codecademy issued this message ...

Oops, try again. Did you remember to print len(my_string)?

You need to do this, otherwise the result will not be displayed ...

print len(my_string)

The output from that line should be ...

4

#5

So what do I type?


#6

Nevermind, I got it to works. Thanks Man :slight_smile:



#7