f = lambda s:''.join(c+c.swapcase()*c.isalpha()for c in s) for s in 'bad', 'Nice', 'T e S t', 's E t', '1!1!1st!', 'n00b', '(e.g.)', 'H3l|@!': print '%-11s%s' % (s,f(s))
Standard input is empty
bad bBaAdD Nice NniIcCeE T e S t Tt eE Ss tT s E t sS Ee tT 1!1!1st! 1!1!1sStT! n00b nN00bB (e.g.) (eE.gG.) H3l|@! Hh3lL|@!