Dec 04, 2025 | 331 words | 3 min read
7.3.1. Task 1#
Learning Objectives#
Create and execute simple scripts comprised of basic Python concepts; Apply course code standard in development of Python scripts; Modularize and comment code in Python for readability and reusability.
Task Instructions#
In this task, you will be doing calculations using both Python and MS Excel. By performing the calculations with both tools, you will gain insight into the differences in syntax between the two
Part A#
Open the MS Word template:
py1_ind_1_username.docxOpen a new MS Excel sheet.
Assuming problems 1–5 shown in Table 7.8 are computed sequentially in the order shown,
Calculate the result of each expression using MS Excel.
Calculate the result of each expression using Python’s interactive mode. Use the same variable names as in the equations.
Fill in the table in your MS Word document, using 4 decimal places when necessary.
Note
You should get the same results in both MS Excel and Python.
Table 7.8 Equations in MS Excel and Python# Problem Number
Equation
MS Excel Calculations
Python Calculations
\(1\)
\(a = 4\)
Cell A1: 4
a = 4
\(2\)
\(b = 3^{1/a}\)
\(3\)
\(c = \log_2(b)\)
\(4\)
\(d = \lceil -3.25 \rceil\)
\(5\)
\(e = 315 \bmod 27\)
Hint
The brackets \(\lfloor \, \rfloor\) denote the floor operation, while \(\lceil \, \rceil\) denote the ceiling operation . See floor and ceiling functions for more information.
Repeat Step 3 for problems 6–10 in Table 7.9, using the values of \(a\), \(b\), \(c\), \(d\), and \(e\) computed above as a data set. It helps to put the results from problems 1–5 in the same row/column in MS Excel, and put them in a list in Python e.g
values = [a, b, c, d, e].Table 7.9 Statistical Calculations in MS Excel and Python.# Problem Number
Calculation
MS Excel Calculations
Python Calculations
6
Find the mean
7
Find the median
8
Find the maximum
9
Find the range
10
Find the standard deviation
Hint
Python’s
mathand/orstatisticsmodules may be helpful.
Part B#
Complete the following steps in your previously created MS Word document:
Add a fifth column with the heading “Differences” to the table from Part A. For each problem, describe any differences you noticed between the MS Excel calculations and the Python calculations.
Did you use any imported libraries in Python, or did you find everything you needed in the standard library? If you used any imported libraries, list which one(s).
What syntax differences exist between Python and MS Excel? Be specific.
Save the MS Word document as a PDF with the name py1_ind_1_username.pdf.
Deliverables |
Description |
|---|---|
py1_ind_1_username.pdf |
A PDF of your completed MS Word document with all calculations and answers to the questions. |