Python for Introductory Statistics: Lab WorkbookXYZ Homework Edition

⇩ Download ▾

1.2 Python Arithmetic Operators

NameOperatorExampleResult
Addition + 5+6 11
Subtraction - 5-6 -1
Multiplication * 5*6 30
Division / 5/6 0.83333
Exponentiation ** 5**2 525^2 =25

Lab 1.2.1

Add a code-cell, type 10 + 10, and click the play button to the left of 10 + 10.

view answer

10+10

Lab 1.2.2

Write a Python code to find the value of 100−88100-88.

view answer

Lab 1.2.3

Write a Python code to perform the operation 12+7.1−10×3\frac{1}{2}+ 7.1 - 10\times3. 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.

view answer

Lab 1.2.4

Write a Python code to perform the operation −5+7−100+0.0510-5+7-\frac{100+0.05}{10}.

view answer

Lab 1.2.5

Write a Python code to perform the operation 1671000000\frac{1}{671000000}.

view answer

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.

view answer

Lab 1.2.7

Write a Python code to evaluate: 28/4×228/4\times2.

view answer

Watch demo video

Lab 1.2.8

Write a Python code to perform the operation: 72+127^2+\frac{1}{\sqrt2}.

view answer

Lab 1.2.9

Write a code for: 72−87^2-\sqrt 8

view answer

Lab 1.2.10

Write a code to evaluate: 72−825\frac{7^2-\sqrt 8}{25}

view answer

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.

These eBooks are a prerelease and are not yet certified conformant with WCAG 2.1 AA or any other accessibility standard. Every page is built against an automated accessibility gate, and our target for the published editions is WCAG 2.2 Level AA. If something is unusable, please tell us.