What is wrong with my code?

It says my code is wrong this is what i wrote:

ministry = “The Ministry of Silly Walks”

#It says “Oops, try again. It looks like you printed " " instead of “27”.”

Judging from the error message, you need to print the length…

print len(ministry)

#ok thank you!!! that really helped and now i understand it better!

You’re welcome. In future, please include a lesson number with your post, or a link to the exercise so we can locate the exercise. Thank you.

I came across the same problem, there isn’t a HINT. Your comment worked for me, but…the number 27…what does it mean? How do you get 27 form the data?

In addition, we’re ask to: invoke the ministry’s .upper() function…I don’t see how this is needed in the exercise. Why not just use: print len(ministry) - print the length of the string defined in the variable ministry.

I printed length
print len(ministry),
but in instruction I should also use .upper() string…

Could you help me?


Check instructions. It says that you should use .upper() function on ministry variable, but you didn’t.

I did itpreviously, but I’ve got:
“Oops, try again. It looks like you printed “THE MINISTRY OF SILLY WALKS” instead of “27”.”

You aren’t asked to print ministry.upper(), but only invoke upper() method. Then print len(ministry).

You have to print len for example print len(ministry)

I already wrote it. Read my post, please.

I did it and had the same result.
See my first post

No, you didn’t. You had only called print len(ministry), but you didn’t call upper() before it.

1 Like

2 posts were split to a new topic: Stuck on the 4th line code