2
I was making a script and her goal was to get the characters to move forward.
But it was only the alphabetic characters that walked a position. And finally she should turn lowercase vowels into uppercase vowels.
Here is the code:
def LetterChanges(str):
x = list(str)
str = ''
for i in range(len(x)):
if x[i] == 'z':
str += 'A'
continue
# testa para ver se faz parte do alfabeto
if x[i].isalpha():
# faz a letra andar uma posição
str += chr(ord(x[i]) + 1)
else:
str += x[i]
# Faz as vogais ficarem grandes
str.replace('e','E')
str.replace('i','I')
str.replace('o','O')
str.replace('u','U')
return str
print(LetterChanges(input()))
The whole code works 100% only the part of the vowels that doesn’t work.
If anyone can help, thank you.
For future visitors, remember that you are overwriting the global function
str()within its functionLetterChanges. It would be better to choose another name for the function argument to not conflict with the built-in functions.– fernandosavio