Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def riocontra(s):
- rr = ''
- words = s.split()
- consonants = string.ascii_lowercase
- for wovel in ['a', 'e', 'i', 'o', 'u']:
- consonants = consonants.replace(wovel, '')
- for word in words:
- if len(word) > 3:
- input = SonoriPy(word)
- out = [input[-1]] + input[:-1]
- ret = ''.join(out)
- if ret[-1] in consonants:
- ret = list(ret)
- ulti = ret[-1]
- penulti = ret[-2]
- ret[-1] = penulti
- ret[-2] = ulti
- ret = ''.join(ret)
- rr += f' {ret}'
- else:
- rr += f' {word}'
- return rr.strip()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement