1.2 Python Arithmetic Operators
| Name | Operator | Example | Result |
|---|---|---|---|
| Addition |
+
|
5+6
|
11
|
| Subtraction |
-
| 5-6 |
-1
|
| Multiplication |
*
|
5*6
|
30
|
| Division |
/
|
5/6
|
0.83333
|
| Exponentiation |
**
|
5**2
| =25 |
Lab 1.2.1
Add a code-cell, type 10 + 10, and click the play button to the left of 10 + 10.
10+10
Lab 1.2.2
Write a Python code to find the value of .
Lab 1.2.3
Write a Python code to perform the operation . On a code-cell type 1/2 + 7.1 - 10*3 and run (execute) the code by pressing the Ctrl+Enter or click the play button.
Lab 1.2.4
Write a Python code to perform the operation .
Lab 1.2.5
Write a Python code to perform the operation .
Lab 1.2.6
For the year 2021, the Illinois state tax is 6.25%. How much state tax will one pay for a car priced at $16,000? Write a Python code to calculate the tax.
Lab 1.2.7
Write a Python code to evaluate: .
Lab 1.2.8
Write a Python code to perform the operation: .
Lab 1.2.9
Write a code for:
Lab 1.2.10
Write a code to evaluate:
Adapted from Python for Introductory Statistics: Student's Lab Workbook, by Simon Aman (Truman College, City Colleges of Chicago), licensed under CC BY 4.0. Changes were made: reformatted as an accessible XYZ web edition with live in-browser code cells. License: CC-BY-4.0.