-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path4_12.py
More file actions
18 lines (12 loc) · 748 Bytes
/
4_12.py
File metadata and controls
18 lines (12 loc) · 748 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
"""
12. A jar of Halloween candy contains an unknown amount of candy and if you can guess exactly
how much candy is in the bowl, then you win all the candy. You ask the person in charge the
following: If the candy is divided evenly among 5 people, how many pieces would be left
over? The answer is 2 pieces. You then ask about dividing the candy evenly among 6 people,
and the amount left over is 3 pieces. Finally, you ask about dividing the candy evenly among
7 people, and the amount left over is 2 pieces. By looking at the bowl, you can tell that there
are less than 200 pieces. Write a program to determine how many pieces are in the bowl.
"""
for i in range(8,200,1):
if(i%5 == 2 and i%6 == 3 and i%7 == 2):
print(i)