"""
Learning Goals:
 - Identify the argument(s), returned value, and side effect(s) of a function call
 - Use function definitions when reading and writing algorithms to implement procedures that can be repeated on different inputs
 - Recognize the difference between local and global scope
"""

abs(-2) # absolute value
pow(2, 3) # raises a number to the given power
round(12.4567, 2) # rounds to the given # sig digs

int("4") # converts a value to an integer
float(3) # converts a value to a float
str(98.9) # converts a value to a string
bool(0) # converts a value to a Boolean

type(4 + 3.0) # returns the type of the eventual value

###

def helloWorld():
    print("Hello World!")
    print("How are you?")

helloWorld()

def hello(name):
    print("Hello, " + name + "!")
    print("How are you?")

hello("Stella")
hello("Dippy")

def makeHello(name):
    return "Hello, " + name + "! How are you?"

s = makeHello("Scotty")

###

def singHappyBirthday(name):
    print("Happy birthday to you")
    print("Happy birthday to you")
    print("Happy birthday dear " + name)
    print("Happy birthday to you!")

val = singHappyBirthday("Dippy")

def addTip(cost, percentToTip):
    return cost + cost * percentToTip

total = addTip(20.00, 0.17)

###

def addItUp(x, y, z):
    answer = x + y
    answer = answer + z

#print(answer) # NameError!

x = 5

def test():
    y = x + 2
    return y

print(test() - x)

x2 = "bar"

def test2():
    x2 = "foo"
    print("A", x2)

test2()
print("B", x2)
