’Tsall good
Perl, the first postmodern computer language — Larry Wall, 1999
“The Python Way” — Tim Peters, 1999
>>> squares = []
>>> for x in range(42):
... squares.append(x*x)
>>> squares = [x*x for x in range(42)]
>>> squares = (x*x for x in range(42))
>>> squares = map(mul, *tee(count())
Users who are unfamiliar with the C getopt()
function or who would like to write less code and get better help and error messages should consider using the argparse module instead.
The unittest unit testing framework was originally inspired by JUnit and has a similar flavor as major unit testing frameworks in other languages.
"double quotes"
'single quotes'
"""triple quotes"""
r'\raw'
R"""\ROAR!!!"""
who, what = 'Thomas', 'noodles''%s likes %s' % (who, what)t = string.Template('$who likes $what') t.substitute(locals())'{} likes {}'.format(who, what)f'{who} likes {what}'
>>> Ω = 'There is more than one way to do it'
>>> F'''\
{ """"""
. join(ω[0]
. upper()
for ω in Ω.split())
}\
'''
'TIMTOWTDI'
The Zen of Python, by Tim Peters
— Larry Wall, 1994
Now that PEP 572 is done, I don’t ever want to have to fight so hard for a PEP and find that so many people despise my decisions.
How many times have we heard the mantra that a program should do one thing and do it well?
Perl, the first postmodern computer language — Larry Wall, 1999
If all you have is a hammer, everything starts to look like a nail.
If all you have is duct tape, everything starts to look like a duct.
When’s the last time you used duct tape on a duct?