4 ms·
"print(random.choice(['svn', 'bzr', 'hg', 'git']))" This actually printed "hg" for me the first time I ran it.
by nik 18y ago
"print(random.choice(['svn', 'bzr', 'hg', 'git']))"
This actually printed "hg" for me the first time I ran it.
- defunkt 18y agoPrinted git for me. Phew.
- plaes 18y agoWeird, I got hg too... And git came on 12th try.
- moe 18y agoTraceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'random' is not defined
- bobbyi 18y agoYou need to edit your ipythonrc so that useful modules like random are imported for you automatically.
- nik 18y agoOh noes, they've removed this piece just after I saw it. It used to say: Chosen DVCS import random print(random.choice(['svn', 'bzr', 'hg', 'git'])) http://svn.python.org/view/peps/trunk/pep-0374.txt?r1=70206&r2=70847 http://svn.python.org/view/peps/trunk/pep-0374.txt?r1=70206&...