le système ne prend pas en compte ma définition de fonction et les différents arguments demandé. je pense qu’il ya un problème avec le système de vérification.
voilà mon code :
def caesar(text,shift):
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 += a
Your code so far
text = 'Hello Zaira'
shift = 3
def caesar(text,shift):
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 += alphabet[new_index]
print('plain text:', text)
print('encrypted text:', encrypted_text)
# User Editable Region
# caesar()
# 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/125.0.0.0 Safari/537.36
Challenge Information:
Learn String Manipulation by Building a Cipher - Step 53
i reset and restart again but i have the same message error( You should pass text and shift as the arguments to your function call by including them inside the parentheses. Don’t forget to separate the arguments with a comma.)
I didn’t delete the function call, it’s just that I can’t share it with you. I’m making another attempt.
It’s the function call at the very bottom of the code, right?
I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.