Learn String Manipulation by Building a Cipher - Step 16

Tell us what’s happening:

Describe your issue in detail here.

Your code so far


# User Editable Region

text = 'Hello World'
shift = 3
alphabet = 'abcdefghijklmnopqrstuvwxyz'
index = alphabet.find(text[0].lower())
print(index)


# User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36

How can I declare a variable named shifted and assign it the alphabet letter at index plus shift ?

You appear to have created this post without editing the template. Please edit your post to Tell us what’s happening in your own words.

Welcome @PMB to FCC community

pls see below link for solution

How do I to find the letter at index 7 plus the value of shift. For that, you can use the addition operator, +, in the same way you would use it for a mathematical addition.

Declare a variable named shifted and assign it the alphabet letter at index plus shift.

the above link contains solution

i will again write it here down

follow below syntax

variablename[a+b]

here variablename is alphabet and a and b are index and shift respectively and assign above syntax after replacing to variable shifted.

I understand this now and resolved the problem. Thank you.

okay thank you this problem is solved. again thank you

1 Like