Exercise

Assignment and variables (2)

Suppose you have $100 stored in my_money, and your friend Dan has $200 dollars. To be clear, you decide to give Dan's money a variable name too. You want to know how much money the two of you have together. Now that each variable has a descriptive name, this is easy using the arithmetic you learned earlier:

my_money + dans_money

Instructions

100 XP
  • my_money has been defined for you.
  • Assign 200 to Dan's money.
  • Follow the example in the exercise text and add your money to Dan's money.
  • Add your money to Dan's money again, but this time save the result to our_money!