# Arup Guha
# 7/17/2015
# Short Example illustrating pass by value vs. pass vy reference.

def main():

    # Strings are pass by value in python.
    name = "Bob";
    print("before in main",name)
    addToString(name)
    print("after in main",name)

    # Lists are pass by reference in python.
    stuff = ["apple","banana","potato"]
    print("before in main",stuff)
    addToList(stuff)
    print("after in main",stuff)

# Make a change to s inside of this function.
def addToString(s):
    s = s + "icious"
    print("in func",s)

# Add an item to mylist inside of this function.
def addToList(mylist):
    mylist.append("end")
    print("in add list",mylist)
    
main()
