Possible Typo in Excercise?


In the instructions, it says,

On line 4, use .len() to print the length of my_string.

This is insinuating to do something like

print my_string.len()

rather than it says to use len() to print the length of my_string, making users do

print len(my_string)

This was simply a problem that I had encountered and finally figured out how to do it. I feel that these instructions might be a bit misleading, unless that is the proper way it should be. Just thought I should point this out.

Strings and Console Output


Seems to do no such thing. How would a learner who knows nothing of methods be led to this conclusion?

print my_string.len()

The lesson shows,

print len(my_string)

Seems very likely they will follow that pattern and not read anything else into it.


In the actual directions it says to use .len() when you should be nesting (is that the right word?) like len() text

I’m just saying that the period seems to imply that it should be at the end of the variable, rather than the variable to be nested inside of len()

Again, I could be wrong.


I’m still mystified by which lesson this is.

On line 1, create a variable named parrot and set it to the string "Norwegian Blue".

On line 2, type len(parrot) after the word print, like so: print len(parrot). The output will be the number of characters in "Norwegian Blue"!


This is in the lesson of Strings, exercise 16, titled “And Now, For Something Completely Familiar”

All I am trying to say is that the instructions specify to use .len() instead of using len(), and I think this may be incorrect

I think I should have specified the exercise, I hope I said this more clearly now.


That still means we have to search for the correct lesson which is a pain. A link is what was asked for. Please and thanks.



(I thought it was linked in the OP, my bad)


That link goes to the start of the unit, but not the lesson. Guess I could have chased down the lesson from there (also, my bad, so we’re even).

Hopefully you will make a habit of starting a new topic with a link from now on. You get much quicker and more accurate responses that way.

Now I see what you mean…

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, use .len() to print the length of my_string.
On line 5, print the .upper() case version of my_string.

Clearly you raise a valid point. Be sure to write a bug report on the instruction text so this error gets corrected. Sorry for the run around.


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