What am I doing wrong?


#1

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.>

https://www.codecademy.com/courses/python-beginner-sRXwR/4/1?curriculum_id=4f89dab3d788890003000096#

Oops, try again. It looks like nothing was printed to the console!


len.(my_string) = "Hello!"
print "5"
print "Hello!.upper()"


#2

1) In python you create a variable by just using a new name and you set it to a value by using = value e.g.

name = value

creates a variable name and sets it to value.
-> Now do the same with my_string as name and anything you like in "" as value

2) print is ok but you should not count the length here :wink: but instead use the len function e.g.
len("Hello") has a value of 5. Btw "Hello!" has 6 characters :slight_smile:

3) Similar problem here. This is a string: "Hello!.upper()" but what you want to do is to use the .upper() method on a string e.g.

"test".upper() -> "TEST"


#3

On line 3, create the variable my_string and set it to any string you'd like:
my_string = "Hello!"

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()