Portfolio

Functions


classmates = {'Tony':'cool but smells', 'Emma':'sits behind me', 'Lucy':'asks too many questions'}
print(classmates)

for k, v in classmates.items():
print(k)
def beef(name= 'buck', action = 'ate', item = 'tuna'):
print(name, action, item)

def add_bitcoin(*args):
total =0
for a in args:
total +=a
print(total)

def allowed_dating_age(my_age):
girls_age = my_age/2+7
return girls_age

def get_gender( sex = 'Unknown'):
if sex is 'm':
sex = "male"
elif sex is 'f':
sex = "female"
print(sex)

def health_calculator(age, apples_ate, cigs_smoked):
answer = (100-age)+(apples_ate*3.5)-(cigs_smoked*2)
print(answer)
data = [28, 20, 0]



beef()
beef("Sally", "farts", "gently")
beef(item = 'awesome', action= 'is')
add_bitcoin(3, 85)
print(allowed_dating_age(28))
get_gender('m')
get_gender('f')
health_calculator(data[0], data[1], data[2])
health_calculator(*data)