you right, my bad for marking the question as an issue. I though because I passed all the other tests and all the tests I failed had the same problem (last person in que) there might have been a problem with the kata.
After 3 ppl successfully pay you for tickets, you will have 75 units of money to use for change.
Might be time to draw some toy paper bills to cut out and re-enact it. Arts n crafts yo.
I don't think so, because from the sale of the first two, the clerk will have 50 with him, after selling the ticket to the third guy, the clerk will give him 25 in change, which will only leave 25 in change with the clerk. If he sold the ticket to the last guy, he would need 75 in change, which he can't give because the clerk only has 25.
My code returns "NO" at that point, but the test wants "YES"
I don't know why my code is not working, I have added a bunch of print statments to show the code logic. The bottom is the print output. Only 3 of the tests return as failed when "Attempt" is pressed. Below is the output for the second test in "Attempt". All of my errors are with people who are last in the que, and there isn't enough change to give them. The bottom returns "No" but the tests wants "YES"
Amount of people in que: 4
This is how much the person in the que gave: 25
The money in the money box if the person did not need change: 25
==========================
This is how much the person in the que gave: 25
The money in the money box if the person did not need change: 50
==========================
This is how much the person in the que gave: 50
This is the money in the box if the person needed change: 25
==========================
This is how much the person in the que gave: 100
Not able to give change because there is only 25 in change
Your logs appear before the error message, not after. Not an issue.
This comment is hidden because it contains spoiler information about the solution
you right, my bad for marking the question as an issue. I though because I passed all the other tests and all the tests I failed had the same problem (last person in que) there might have been a problem with the kata.
After 3 ppl successfully pay you for tickets, you will have 75 units of money to use for change.
Might be time to draw some toy paper bills to cut out and re-enact it. Arts n crafts yo.
I don't think so, because from the sale of the first two, the clerk will have 50 with him, after selling the ticket to the third guy, the clerk will give him 25 in change, which will only leave 25 in change with the clerk. If he sold the ticket to the last guy, he would need 75 in change, which he can't give because the clerk only has 25.
My code returns "NO" at that point, but the test wants "YES"
so rather than print("your answer") you should do return "your answer"
Does it mean that input is
[25, 25, 50, 100]
? If so, then the last person can get the needed change, can't they?I think you might be printing the output rather than returning it
I don't know why my code is not working, I have added a bunch of print statments to show the code logic. The bottom is the print output. Only 3 of the tests return as failed when "Attempt" is pressed. Below is the output for the second test in "Attempt". All of my errors are with people who are last in the que, and there isn't enough change to give them. The bottom returns "No" but the tests wants "YES"
Amount of people in que: 4
This is how much the person in the que gave: 25
The money in the money box if the person did not need change: 25
==========================
This is how much the person in the que gave: 25
The money in the money box if the person did not need change: 50
==========================
This is how much the person in the que gave: 50
This is the money in the box if the person needed change: 25
==========================
This is how much the person in the que gave: 100
Not able to give change because there is only 25 in change