Question 3: Operator Pocket Money

💰 Pocket Money Savings

Use: import task_operators_03

Tunde gets 20 naira from his dad every week. He saves 12 naira and spends the rest on snacks. He wants to know how much he spends in one week and how much he will have saved after 4 weeks.

Write a Python program that calculates Tunde’s spending and savings.

  • Store Tunde’s name in a variable called name and set it to “Tunde”.
  • Store the weekly money in a variable called weekly_money and set it to 20.
  • Store the amount he saves each week in a variable called weekly_savings and set it to 12.
  • Calculate how much he spends per week and store it in weekly_spending using weekly_money - weekly_savings.
  • Store the number of weeks in a variable called weeks and set it to 4.
  • Calculate the total savings after 4 weeks and store it in total_savings using weekly_savings * weeks.
  • Print exactly one line in this format:
    <name> spends <weekly_spending> naira per week and saves <total_savings> naira in <weeks> weeks.
Write what you are looking for, and press enter to begin your search!