Build a Caesar Cipher - Step 10

Tell us what’s happening:

alphabet = ‘abcdefghijklmnopqrstuvwxyz’
shift = 5
shifted_alphabet = alphabet[shift:] + alphabet[:shift]
translation_table = str.maketrans(alphabet, shifted_alphabet)
text = ‘hello world’
encrypted_text = text.translate(translation_table)
print(encrypted_text)

solv it

Your code so far


# User Editable Region


alphabet = 'abcdefghijklmnopqrstuvwxyz'
shift = 5
shifted_alphabet = alphabet[shift:] + alphabet[:shift]
translation_table = str.maketrans(alphabet, shifted_alphabet)
text = 'hello world'
encrypted_text = text.translate(translation_table)
print(encrypted_text)

# 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/144.0.0.0 Safari/537.36

Challenge Information:

Build a Caesar Cipher - Step 10

What is this step asking you to do?

Hi, welcome to the forum. We see you have posted some code but did you have a question?

হ্যালো, ফোরামে আপনাকে স্বাগতম। আমরা দেখতে পাচ্ছি আপনি কিছু কোড পোস্ট করেছেন তবে আপনার কি কোনও প্রশ্ন ছিল?

Google translate exists, use it if you need it. Looking forward to your question

গুগল ট্রান্সলেট আছে, প্রয়োজনে এটি ব্যবহার করুন। আপনার প্রশ্নের অপেক্ষায় রইলাম