Learn String Manipulation by Building a Cipher - Step 49

Tell us what’s happening:

text = ‘Hello Zaira’
shift = 3

def caesar():
alphabet = ‘abcdefghijklmnopqrstuvwxyz’
encrypted_text = ‘’

for char in text.lower():
    if char == ' ':
        encrypted_text += char
    else:
        index = alphabet.find(char)
        new_index = (index + shift) % len(alphabet)
        encrypted_text += alphabetb    

[new_index] return hjhhjhjjjencrypted_text encrypted_text = caesar(()
print('pla

Your code so far


# User Editable Region



# User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Mobile Safari/537.36

Challenge Information:

Learn String Manipulation by Building a Cipher - Step 49

Please Tell us what’s happening in your own words.

Learning to describe problems is hard, but it is an important part of learning how to code.

Also, the more you say, the more we can help!

Welcome to the forum @Sagar_12

image

There is a message in the console.

Happy coding