sayings.py
author Peter Koppatz <peter@koppatz.com>
Sat, 18 Jan 2014 21:05:22 +0100
changeset 144 3b768d0f09ef
parent 141 ea70f3d81676
child 146 2e05b89881ed
permissions -rw-r--r--
code revue
     1 from random import shuffle
     2 
     3 def get_saying():
     4     sayings = [('The Zen of Python, by Tim Peters', '__Tim Peters, The Zen of Python'),
     5                ("Beautiful is better than ugly.", '__Tim Peters, The Zen of Python'),
     6                ("Explicit is better than implicit.", '__Tim Peters, The Zen of Python'),
     7                ("Simple is better than complex.", '__Tim Peters, The Zen of Python'),
     8                ("Complex is better than complicated.", '__Tim Peters, The Zen of Python'),
     9                ("Flat is better than nested.", '__Tim Peters, The Zen of Python'),
    10                ("Sparse is better than dense.", '__Tim Peters, The Zen of Python'),
    11                ("Readability counts.", '__Tim Peters, The Zen of Python'),
    12                ("Special cases aren't special enough to break the rules.", '__Tim Peters, The Zen of Python'),
    13                ("Although practicality beats purity.", '__Tim Peters, The Zen of Python'),
    14                ("Errors should never pass silently.", '__Tim Peters, The Zen of Python'),
    15                ("Unless explicitly silenced.", '__Tim Peters, The Zen of Python'),
    16                ("In the face of ambiguity, refuse the temptation to guess.", '__Tim Peters, The Zen of Python'),
    17                ("Although that way may not be obvious at first unless you're Dutch.", '__Tim Peters, The Zen of Python'),
    18                ("Now is better than never.", '__Tim Peters, The Zen of Python'),
    19                ("Although never is often better than *right* now.", '__Tim Peters, The Zen of Python'),
    20                ("If the implementation is hard to explain, it's a bad idea.", '__Tim Peters, The Zen of Python'),
    21                ("If the implementation is easy to explain, it may be a good idea.", '__Tim Peters, The Zen of Python'),
    22                ("Namespaces are one honking great idea -- let's do more of those!", '__Tim Peters, The Zen of Python'),
    23                ]
    24     
    25     shuffle(sayings)
    26     
    27     saying, author = sayings[0]
    28     return saying, author
Impressum Datenschutzerklärung