'''
Created on Sep 8, 2014

@author: Susan
'''

    
    
# this function returns a value
def duplicate(word, num):
    return word * num

# this function prints a value and does not return anything
def duplicate2(word, num):
    print word * num
    
# this function calculates a value, and then does not return or 
# print it. It is a useless function.
def duplicate3(word,num):
    word * num
    
    


if __name__ == '__main__':
    
    # this line calls duplicate, which returns a value, and then prints that value.
    print duplicate ("Go", 3) 
    
    # this line calls duplicate2 which prints a value, then does not return. 
    # this print then tries to print the return value, but since there is 
    # not a return value, it prints "None"
    print duplicate2("Go", 5) 

    # this line calls duplicate3, which calculates a value, but doesn't do anything with it.
    # then the print tries to print the return value, but since there is
    # not a return value, it prints "None"
    print duplicate3("Go", 2)
    
    # this line calls duplicate which returns a value. Then we do nothing
    # with the return value. Nothing is printed.
    duplicate("Go", 5)
    
    # this line calls duplicate2, which prints the computed value, then 
    # returns nothing. 
    duplicate2("Go", 4)
    
    # this line calls duplicate3, which computes a value and does nothing with it.
    # this line does not print anything.
    duplicate3("Go", 2)
    
    # this line shows another way to use the return value from a function.
    # Store it in a variable so you can do something with it. In this
    # case, we print it after we store it in x.
    x = duplicate("go", 3)
    print x

    