
# Python, for the second easy piece
# created by burt rosenberg
# august 2012

# what is a program?
# statements and code flow
# what is a variable?
# box model of execution


# how to define a procedure
def hello_world_program():
    print "hello world!"

# how to use a while loop
def boom_program():
    i = 10
    while i>=0:
        print i
        i = i - 1
    print "BOOM!"

# how to pass parameters to a function
def boom_program_i(i):
    while i>=0:
        print i
        i = i - 1
    print "BOOM!"


# how to use a for loop
def for_program(i):
    for j in  [5,3,"hi",2]:   #range(0,i,2):
        print j

# how to use lists
def list_program():
    verbiage = [",", "- buckle my shoe\n", ",", "- shut the door\n",
                ",", "- pick up sticks\n", ",", "- lay them straight\n"] ;
    for j in range(0,len(verbiage)):
        print j+1,verbiage[j],

# how a string is a list
def string_program():
    s = "hello world"
    for c in s:
	print s


# how to use dictionaries
def dictionary_program():
    verbiage = { "greeting": "To Whom It Might Concern",
                 "closing": "Please accept my most distinguished sentiments"
                 }
    print "%s\nWe have reviewed our decision and it is all for the best.\n%s" % (
        verbiage['greeting'],verbiage['closing'])

        
print "Hello World!"
