simple program fragments
# This is a comment.
# Any text starting with the # symbol is for human consumption and is ignored by JES
# until the start of the next line
# Here are some code starting points
# Multiply two numbers
def multiply(x, y):
pass # Replace this during lecture with code that multiplies & prints
# Make someone older and wish them happy birthday
def birthday(name, age):
print "Happy birthday..."
pass # Increment age by one
print "You are now..."
# Print picture's height and width.
def detailsPic(picture):
pass
# From previous lecture
def pickAndShow():
filename = pickAFile()
picture = makePicture(filename)
show(picture)
Link to this Page