Semantic whitespaces (newlines, indentation) • English keywords (and, or, not, in, is, as) • Operator overloading (”hello “ + “world”) There should be one—and preferably only one— obvious way to do it Wikipedia
= input(“Enter F degrees: “) f = float(f) return (f – 32) * 5 / 9 def c2f(c=None): if c is None: c = input(”Enter C degrees: “) c = float(c) return 9 / 5 * c + 32 tiny.cc/PyF2C
n devs = (x – mean for x in numbers) squared_devs = (x*x for x in numbers) var = sum(squared_devs) / n std = var**0.5 def make_power(a): def power(x): return x**a return power square = make_power(2) square(4) # => 16 closure
Rossum in the Netherlands • Python 2.0 released Oct 2000 • Many major new features: – cycle-detecting garbage collector – support for Unicode – shift to transparent and community-backed development • Python 3.0 released Dec 2008 – major backwards-incompatible release – many of major features backported to Python 2.6 and 2.7 • Python 3.5 released Sep 2015 • Python 3.7 beta available, final expected June 2018