Question 8: Input Sharing Is Caring

❤️ Sharing Is Caring

Use: import task_input_08

Zara earns money by doing chores and wants to share her earnings. She decides to keep some for herself and give the rest to a local animal shelter. Write a Python program that asks Zara about her earnings and calculates her savings and donation.

  • Use input("What is your name? ") to ask for her name. Store it in name.
  • Use input("How much did you earn? ") to ask how much money she earned. Store the answer in earnings_text.
  • Convert earnings_text to an integer using int() and store it in earnings.
  • Use input("How much to keep? ") to ask how much she wants to keep for herself. Store it in keep_text.
  • Convert keep_text to an integer using int() and store it in keep.
  • Store the amount she wants to donate in donation using earnings - keep.
  • Store a thank-you message in message and set it to “Thank you for sharing!”.
  • Print exactly two lines:
    Name: <name>
    Donation: <donation>
  • Print one more line after that:
    <message>
Write what you are looking for, and press enter to begin your search!