Kernel: Python 3 (system-wide)
Exam 1
a)
In [87]:
Enter number of children
Enter number of adults
Number of people is too many for a 50 seat theater
In [81]:
Enter a positive integer
2.283333333333333
a)
In [0]:
b)
In [56]:
[3, 6, 9, 12, 18, 27, 36, 54, 108, 129, 258, 387, 516, 774, 1161, 1548, 2322]
a)
In [65]:
Account total after 15 years: $ 1830.5
b)
In [73]:
Minimum monthly deposit to ensure $3000 after 15 years: $ 5
a)
In [0]:
b)
In [88]:
---------------------------------------------------------------------------
RecursionError Traceback (most recent call last)
<ipython-input-88-8b79b06b28c9> in <module>
9 return stairs(s-1)+stairs(s-2)+stairs(s-5)
10
---> 11 stairs(15)
<ipython-input-88-8b79b06b28c9> in stairs(s)
7 return 5
8 else:
----> 9 return stairs(s-1)+stairs(s-2)+stairs(s-5)
10
11 stairs(15)
... last 1 frames repeated, from the frame below ...
<ipython-input-88-8b79b06b28c9> in stairs(s)
7 return 5
8 else:
----> 9 return stairs(s-1)+stairs(s-2)+stairs(s-5)
10
11 stairs(15)
RecursionError: maximum recursion depth exceeded in comparison
a)
In [113]:
[<matplotlib.lines.Line2D at 0x7f77c9bf6fa0>]
b)
In [105]:
In [103]:
5
In [112]:
6.970001
In [111]:
0.0021484375000000006