3.16 It's saying I didn't make a string... help?


#1

my_string = "kittens!"
print (len)my_string
print my_string.upper()

The error says "Oops, try again. Did you create a variable called my_string?

What should I do?


#2

@sabersaver,

you will have to use

print len(my_string)

in your code...

google search
== the Book ==
https://docs.python.org/2/library/functions.html
and
https://docs.python.org/2/library/stdtypes.html
topic: 5.6.1. String Methods


#4

Thank you very dearly!!


#5

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

the error says :

File "python", line 3
my_string = "valuable"
^
IndentationError: unexpected indent
How can I solve this?


#6

Hello,
when you said it should be this
print len("my_string")
print"my_string".upper()
The speech marks,Quotes should not be there .


#7
  1. print len("my_string") --> wrong
    print len(my_string) --> correct

You quoted variable name my_string.

  1. python use indentation, maybe you added one ore more space in front of my_string. You have to use only 4 spaces in front of my_string = "valuable", delete the other