Tell us what’s happening:
I tried to call the function and I called correctly and shows exactly the final result, but the tutorial still says that “You should call your function again, this time passing text and 13 as arguments.” Things that I already made. Tried to do the correct thing, done the correct function call but the tutorial still shows that my code didn’t pass. Why?
Your code so far
text = "Hello Zaira"
def caesar(text, offset):
alphabet = 'abcdefghijklmnopqrstuvwxyz'
encrypted_text = ''
for char in text.lower():
if char == ' ':
encrypted_text += char
else:
index = alphabet.find(char)
new_index = (index + offset) % len(alphabet)
encrypted_text += alphabet[new_index]
print('plain text:', text)
print('encrypted text:', encrypted_text)
caesar(text, 13)
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 Edg/120.0.0.0
Challenge Information:
Learn String Manipulation by Building a Cipher - Step 51