Lol oh wiat
Lol oh wiat
To the world, you may be one person, but to a person, you may be the world...
lol
wlel, wdors taht hvae olny 1, 2, or 3 ltertes arne't mxied up.
Can smoeone taht knwos phyotn uatpde tihs sirpct so taht it d'osent lveae any wdros "unuemixd" or at lsaet kepes the fsirt and lsat leertts of ecah
wrod in tiehr onrigail ltoaicons (rmianeing as the fsirt and lsat lterets atfer mxiing up the ohetr letetrs)?
hree it is:
Code:#!/usr/bin/python # -*- coding: utf-8 -*- import random def Mixup(word): if len(word) < 4: return word chars = [None] * (len(word) - 2) positions = range(len(word) - 2) for char in word[1:-1]: pos = random.choice(positions) chars[pos] = char positions.remove(pos) return word[0] + "".join(chars) + word[-1] try: while True: print " ".join([Mixup(word) for word in raw_input().split()]) except (EOFError, KeyboardInterrupt): pass
Ah! I teird it but it dind't mix up wrdos taht hvae fuor lttres.
EIDT: I dno't tnihk taht it wulod wrok wtih fvie or mroe ltetrs as wlel.
Last edited by calvinps; April 27th, 2009 at 01:35 PM.
bmup
wut
Bookmarks