Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Purposely obfuscated ("concise", "efficient")
- v = list("aeiou")
- def pig(w):
- if not w.isalpha(): return w
- w = w.lower()
- if w[0] in v: return w+"way"
- for i, c in enumerate(w):
- if c in v: return w[i:]+w[:i]+"ay"
- return w+"ay"
- def pigs(ws):
- return " ".join([pig(w) for w in ws.split()])
- print(pigs("print statements are fun"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement