Two Strings - Swap Vowels --> 20/9/21


PYTHON:

s=list(input().strip());x=0;y=0

d=list(input().strip());a=[];b=[]

a=[i for i in s if i in 'aeiou']

b=[i for i in d if i in 'aeiou'];k=min(len(a),len(b))

for i in range(len(s)):

    if s[i] in 'aeiou' and x<k:s[i]=b[x];x+=1

    print(s[i],end='')

print()

for i in range(len(d)):

    if d[i] in 'aeiou' and y<k:d[i]=a[y];y+=1

    print(d[i],end='')

Post a Comment

0 Comments