@@ -63,6 +63,54 @@ In the example above, 5 is the lower limit of the range and 60 is the upper limi
63
63
of the range. If your range needs to be different, then changes either or both of
64
64
these values.
65
65
66
+ ## Basic Mathematics
67
+
68
+ ### Addition
69
+
70
+ To do addition in Python, just have to code out two numbers and add them together
71
+ like you would normally do for a math problem that you were writing on paper. Just
72
+ keep in mind that the calculations always have to be done on the right side of the
73
+ equals sign and will be set to the variable on the left of the equals sign.
74
+
75
+ ``` python
76
+ sum = 5 + 3
77
+ print sum
78
+ ```
79
+
80
+ From the example above, the output will print 8.
81
+
82
+ ### Subtraction
83
+
84
+ Similar in fashion, subtraction is written just like addition, except it uses the
85
+ minus sign instead of the plus sign.
86
+
87
+ ``` python
88
+ difference = 10 - 3
89
+ print difference
90
+ ```
91
+
92
+ From the example above, the output will print 7.
93
+
94
+ ### Multiplication
95
+
96
+ Multiplication is done using the asterisk.
97
+
98
+ ``` python
99
+ product = 4 * 3
100
+ print product
101
+ ```
102
+
103
+ From the example above, the output will print 12.
104
+
105
+ ### Division
106
+
107
+ ``` python
108
+ quotient = 20 / 5
109
+ print quotient
110
+ ```
111
+
112
+ From the example above, the output will print 4.
113
+
66
114
## More Resources
67
115
68
116
The Raspberry Pi traffic light project is written in Python code. You can review the
0 commit comments