Write a program that asks the user to enter a string s1 and outputs the string s2 obtained by
reversing the order of vowels present in s1, while maintaining the other letters in their orginal
position as in s1.
Answers
Answered by
1
#this means a comment
#this program is in python
a=input("enter string 1")
b=["a","e","i","o","u"]#a list of vowels
c="" #empty string
for i in range(len(a),-1,-1,-1): #the loop starts from the last element to first #element
if a[i] in b:
c=c+a[i]
print("the new string s2:",c)
Similar questions
Social Sciences,
6 months ago
Hindi,
6 months ago
English,
6 months ago
English,
1 year ago
Environmental Sciences,
1 year ago
Science,
1 year ago
History,
1 year ago