0
How to replace the vowels in the string with the vowels in circular order
In python 3
13 ответов
+ 3
Fermi what is the import re does
And re.sub does I can't understand
+ 3
What does iter do? What does print do? What does n%5 mean? Sorry man, but you're not going to learn anything if you ask others to think for you
+ 1
Can you give us examples of what input and what corresponding output you expect to get? "Vowels in circular order" is a little vague.
+ 1
Do you mean shifting the vowels by three places?
a -> o
e -> u
i -> a
o -> e
u -> i
+ 1
str = 'King Kong'
vowelorder = 'a,e,i,o,u'.split(',')
n = 0
for i in str:
if i in vowelorder:
print(vowelorder[n%5], end='')
n+=1
else:
print(i,end='')
# cheers, but you should have shown your own attempt!
0
Input :King Kong
Output :kang keng
Vowels in string are i and o they are replaced by a and e like.wise
0
Same aeiou
0
Sorry, no need for regex. I was thinking along the lines of substituting the characters. If you want to learn more about regex, give it a search in the Learn section. :>
0
What does n%5 indicates
0
What does iter do
- 1
Nope ..diego
- 1
What's the output of "aeiou"?