Hi guys i am stuck on the step 42 I filled all what prompted :" Now, instead of printing 'space!'
, use the addition assignment operator to add the space (currently stored in char
) to the current value of encrypted_text
. my answer was as bellow:
text = 'Hello World'
shift = 3
alphabet = 'abcdefghijklmnopqrstuvwxyz'
encrypted_text = ''
for char in text.lower():
if char == ' ':
char += new_index
index = alphabet.find(char)
new_index = index + shift
encypted_text += new_index
print('char:', char, 'encrypted text:', encrypted_text)