Case-sensitivity: why -- or why not? (was Re: Damnation!)

Moshe Zadka moshez at math.huji.ac.il
Tue May 23 02:30:04 EDT 2000


On Mon, 22 May 2000, Ivan Van Laningham wrote:

> Hi All--
> 
> Ben Cornett wrote:
> > 
> > this IS An exAmple oF WHat I meaNt WHEn I SAid "vOtIng DoesN'T HElP".
> > 
> 
> I bet you wrote a Python program to do this, didn't you?  Post the code!

#released to the public domain by Moshe Zadka
import sys, string, random

functions = [string.lower, string.upper]

s = sys.stdin.read()
for c in s:
        sys.stdout.write(random.choice(functions)(c))

--
Moshe Zadka <moshez at math.huji.ac.il>
http://www.oreilly.com/news/prescod_0300.html
http://www.linux.org.il -- we put the penguin in .com





More information about the Python-list mailing list