A cash drawer contains 160 bills, all 10s and 50s. The total value ofthe 10s and 50s is $1,760.
How many of each type of bill are in the drawer? You can figure thisout by trial and error (or by doing algebra with pencil and paper),but try to use loops and conditionals to check a plausiblepossibilities and stop when you find the correct one.
Algebraically, on a piece of paper I figured out that it was four $50 bills and one hundred and fifty six $10 bills. This is because
x+y=160
10x+50y=1760
x=160-y
10x=1600-10y
1600-10y+50y=1760
1600-40y=1760
40y=1760
y=4
x=156
how would I make a model that i could code to solve this or any other version of this problem? I only know the very basic syntax of python as i've never ever programmed before this.