Year 7 · Python · Challenge 1

Pocket Money Planner

Ask for pocket money and spending, then work out what is left and how many weeks to save for a gift.

inputcastingvariablesmaths

Scenario: You are saving for a birthday gift. Write a program that plans your pocket money.

Your tasks

  1. Ask for the gift cost (use float so decimals are allowed).
  2. Ask how much pocket money you get each week (also a float).
  3. Ask how much you spend each week (a float).
  4. Work out how much you can save each week: pocket money minus spending.
  5. Print how much you save each week.
  6. Work out how many whole weeks you need to save enough for the gift. Use integer division //. If there is a remainder, you need one more week — use % to check.
  7. Print the number of weeks needed.
💡 Remember: input() always gives a string. Convert with float() before doing maths.
💡 Try the whole challenge in your editor first. Only reveal the solution when you have had a proper go.

Year 7 tutorial · Next: Challenge 2