Practice problem


#1

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>

<In what way does your code behave incorrectly? Include ALL error messages.> The assignment calls for:
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. Yet I keep getting this error:
Did you remember to print len(my_string)? and I cant advance to the next lesson

<What do you expect to happen instead?>

It printed to the console just fine

```python

my_string = "love in the morning"
print len(“my_string”)
print my_string.upper()
print len(“my_string”)

<do not remove the three backticks above>

#2

So, look here:

Look at "my_string", do you notice that it’s a string? There’s quotation marks surrounding it.


Currently, it’s not going to print the len() of what’s assigned to our variable my_string (which is "love in the morning"); it’s only going to print the len of this string: "my_string". :slight_smile:


#3

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