Stuck again on Python


File "python", line 4
print "my_string".
SyntaxError: invalid syntax

Write your code below, starting on line 3!

print "my_string".
print "my_string".upper()

Replace this line with your code.


Lets look at this step by step.

1.) On line 3, create the variable my_string and set it to any string you'd like.
So you have my string in quotes but you didn't create my_string as a variable equal to a string. So go back and change that.

2.) On line 4, print the length of my_string.
So the key here is print the length of my_string. Now that you have declared my_string as a variable you want to print length of my string accordingly. If you need a hint on how to print the length just say so.

3.) For this one once again you have my_string as a variable not as a string so get rid of the quotation marks and your good there.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.