Python: Math, Familiar

Go to Chapter 4 of A Smarter Way.

1. Assigning a number value to a variable:

my_number = 4

2. Assigning a number by doing math:

another_number = 2 + 2

3. Doing math directly with variables:

my_sum = my_number + another_number

Exercise

Go to http://www.asmarterwaytolearn.com/python/4.html and review the exercises.

  1. Continue editing examples.py.
  2. You are going to both do math, and print what you are doing.
  3. Your printed output should read: “Sum: 2 + 5 = 7”.
  4. The first part can be a simple print.
  5. However, the 10 must be the result of math in code.