Learn String Manipulation by Building a Cipher - Step 7

Tell us what’s happening:

I’m totally stuck at this problem right here, yes you’re gonna laugh it’s only the seventh one but none the less I need the help.
It says you goota use the len() fuction so that’s what I did.
I used
text = ‘Hello world’
print(text-1)
len(text-1)

Its safe to say I’ve been stuck all day here.

Your code so far


# User Editable Region

text = 'Hello World'
len[text-1]

# User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:124.0) Gecko/20100101 Firefox/124.0

Challenge Information:

Learn String Manipulation by Building a Cipher - Step 7

INSTRUCTIONS:
You can access the number of characters in a string with the built-in len() function.
Modify your existing print() call by passing len(text) instead of text[-1].

So they are telling you that len() give you the length of variables, in this case len(text) will give you the amount of characters in the string assigned to the variable text. So you want to (in the () of your print statement) replace text[-1] with len(text).

hint:

a(b(c))
1 Like

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