# doingwrong.py  20080926  jim@well.com  --------------- 


# function definitions on top so they're globally available 
def doit(): 
   # this is how to create a function 
   x = ((4 * 5) + (2 * 3) 
   print "From the doit() function: x = ", x
   return x 


# using print statements throughout the program let you 
# see the program flow--if any error messages occur, the 
# previous and following print statements let you identify 
# the part of your code that's suspect. 
print "\n\nstarting to run\n" 

# this calls the previously defined doit() function 
doit() 

# the first use of the doit() function ignored the value 
# that doit() returned. this next use shows how to capture 
# a function's return value and use it. 
print "\n\nadding a feature" 

y = doit() 
print "\ncaptured doit's return as y and adding one: ", (y + 1) 

print "\n\nend of program\n\n\n\n" 

# ---------------End Of Program---------------


