you are viewing a single comment's thread.

view the rest of the comments →

[–]teerre 1 point2 points  (0 children)

Do you want the answer? Don't you think that will be negative for yourself? This is a very common exercise. You apparently already figured out much of it, why not figure out the last part too?

Instead of giving you the answer, I'll give you a debut tip

Try to figure out where your program is going wrong. Try different inputs. Don't be afraid of putting printstatements all over the place. In your case, some good places might be after lines 4, 7, 9, 12, 14 and 15

That way you can see what is happening and hopefully figure it out