Advertisement
Cyoce

SpoonerisePy

Jan 13th, 2016
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.28 KB | None | 0 0
  1. i=input()
  2. f=l=''
  3. A='aeiou'
  4. for j in A:
  5.  I=i[0];J=I.find(j)
  6.  if ~J:
  7.   if f:
  8.    if f>I[0][:J]:f=I[:J];break
  9.   else:f=I[:J]
  10. for j in A:
  11.  Y=i[1];J=Y.find(j)
  12.  if ~J:
  13.   if l:
  14.    if l>Y[:J]:l=Y[:J];break
  15.   else:l=Y[:J]
  16. i[0]=I.replace(f,l)
  17. i[1]=Y.replace(l,f)
  18. print ' '.join(i)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement