


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



def mult(a, b): if b == 1: return a else: return a + mult(a, b-1)
multiply(4, 2) 8 multiply(0, 85)
multiply(14, 23) 322 Part 2 – Summation
summation(4) 10 summation(31)
496 Part 3 – Digit Sum
digitSum(4) 4 digitSum(14) 5 digitSum(987654) 39
Part 4 – The Road Trip!
(c) I am lost (q) Quit-get me out of here! Please enter your response (lowercase letter): b You spent $21.00 to get a hotel room and have $74.00 left How is that drive going? (a) I am hungry (b) I am sweepy (c) I am lost (q) Quit-get me out of here! Please enter your response (lowercase letter): c You were abducted and it cost $100.00 to get out of that situation with $- 26.00 left
roadtrip(250) How is that drive going? (a) I am hungry (b) I am sweepy
(c) I am lost (q) Quit-get me out of here! Please enter your response (lowercase letter): a You spent $8.00 on those snacks and have $242.00 left How is that drive going? (a) I am hungry (b) I am sweepy (c) I am lost (q) Quit-get me out of here! Please enter your response (lowercase letter): q Final thoughts