# BAD
import simplegui, math
# GOOD
import simplegui
import math
# FINE
from math import sqrt, pi
# BAD
def foo():
print "My indentation sucks"
# GOOD
def bar():
print "My indentation rocks"
# WHITESPACES - 1
sqrt (2) # BAD
sqrt(2) # GOOD
# WHITESPACES - 2
# BAD
x=1
y = 1
z = 3*2
# GOOD
x = 1
y = 1
z = 3 * 2
spacing_matter = True
def pow(x, y):
"""Returns the yth power of x"""
return x ** y
def pow(x, y):
"""
This is a very stupid function which returns the yth power of x
Positional Arguments
x -- number
y -- index
"""
return x ** y
"First solve the problem. Then write the code" - John Johnson