Learn String Manipulation by Building a Cipher - Step 38

Tell us what’s happening:

Hi everyone, I’m facing an issue with the step 38 of the Sientific computing with python certification

the code looks correct but tester says there’s something wrong, anyone facing the same problem?

Your code so far


/* User Editable Region */

text = 'Hello World'
shift = 3
alphabet = 'abcdefghijklmnopqrstuvwxyz'
encrypted_text = ''

for char in text.lower():
    if (char == " "):
        print('space!')
    index = alphabet.find(char)
    new_index = index + shift
    encrypted_text += alphabet[new_index]
    print('char:', char, 'encrypted text:', encrypted_text)

/* User Editable Region */

Challenge Information:

Learn String Manipulation by Building a Cipher - Step 38

step 30 or step 38?

do not use the parentheses

2 Likes

Thank you very much @ILM, problem solved
I’m used to parentheses, as they are critical in most programming languages :yawning_face:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.