Download (right-click, save target as ...) this page as a jupyterlab notebook from:
LAST NAME, FIRST NAME
R00000000
ENGR 1330 Laboratory 2 - Homework
Notice the code cell below! From this notebook forward please include and run the script in the cell, it will help in debugging a notebook. Its ok if the code makes no sense right now - mostly the cell executes system commands. As you change machines, and rerun the cell the output will change (its supposed to!)
# Preamble script block to identify host, user, and kernel
import sys
! hostname
! whoami
print(sys.executable)
print(sys.version)
print(sys.version_info)
atomickitty sensei /opt/jupyterhub/bin/python3 3.8.10 (default, Jun 2 2021, 10:49:15) [GCC 9.4.0] sys.version_info(major=3, minor=8, micro=10, releaselevel='final', serial=0)
The cell below is type RAW, change it into a code cell and activate (suppress the comments) and run the script.
What is the value of area?
Copy your working script below and add necessary code to output the value of area.
# copy here
Change the RAW cell below into a Code cell, and run the script (fix any syntax errors)
a. Of the six variables, which are integers?
# put your answer here
b. What is the difference (in effect) between x1=1.0 and y1=1.?
# put your answer here
c. Examine the division results; Why does z1//z2 return a value of 0?
# put your answer here
Then change the cell below to code and run it.
Now using the example in the cell above, exaluate the following expressions in the indicated cells below:
#c = a - b
#c = a * b
#c = a / b
#c = a % b
#a = 2, b = 3, c = a** b
#a = 10, b = 5, c = a//b