Please send questions to
st10@humboldt.edu .
#---------------------------------------------------------
# Module name: lect10.py
# Demonstration that def statement really
# is an executable statement, capable of
# being put where a statement can be put
# (here, as amongst an if-statement's
# actions)
# By: Sharon M. Tuttle
# last modified: 10-26-05
#---------------------------------------------------------
factor = raw_input("enter a desired factor: ")
factor = int(factor)
if factor < 0:
def try_me(val):
return val * factor
elif factor == 0:
def try_me(val):
return val
else:
def try_me(val):
return val / factor