



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




print() python3 ./username-lab1a.py print('hello world') NET2008A โ DevOps โ Fall 2022 - Lab 1
Download PyCharm Community Edition for free and install it on your computer. Use PyCharm for PART 2 to PART 4.
Following the installation guide of Anaconda on their website. Use JupyterLab for PART 5. To launch JupyterLab, open Anaconda-Navigator and launch JupyterLab: webpage will open in your browser showing the JupyterLab interface: Once you have JupyterLab set up, we will be using it for future lab distributions.
You will learn to create a simple python script in this section. This python script will just call the Python built-in function print() to send the text "hello world" to the screen. The "hello world" is an old traditional first program students usually are taught to create, which is based on the first programming example from the first C programming text co-written by Dennis Ritchie, the creator of the C programming language and Brian Kernighan. You will learn how to run the Python script in the Python3 shell as well as to learn how to run the Python script from the bash shell. Perform the following steps:
'hello world' is called a 'string'. In the above example, a string was passed as an argument to the print function. These words are important for understanding and talking about different aspects of code.
num1 = 5 num2 = 10 print(num1) print(num2) sum = num1 + num print(sum) print('The sum is: ' + sum) print('The sum is: ' + str(sum)) cd ~/net2 0 08/lab1/ ./username-lab1c.py Isaac is 72 years old! print( 10 + 5 )# addition print( 10 - 5 )# subtraction print( 10 * 5 )# multiplication print( 10 / 5 )# division print( 10 ** 5 )# exponents
In the previous section, you performed a couple of simple mathematical operations. In this section, you will learn some additional mathematical operations.
cd ~/net2 0 08/lab1/ ./username-lab1d.py 10 + 2 * 5 = 20 print( 10 + 5 * 2) print(( 10 + 5) * 2) print( 10 + 5 * 2 - 10 **
print( 15 / 3 * 4) print( 100 / (( 5 + 5) * 2 ))
multiplication
right # division and multiplication happen from left-to-right
Repeat PART 4 in JupyterLab. Run all lines in JupyterLab and add a brief introduction using Markdown blocks. Save the notebook file as username-lab1e.ipynb (The .ipynb extension is specific for Jupiter Notebook files)
Submit your lab files to Brightspace for marking. Be ready to show : Output of: cat username-lab1a.py username-lab1b.py username-lab 1 c.py username- lab1d.py Output of username-lab 1 a.py username-lab1b.py username-lab 1 c.py username-lab1d.py File username-lab1e.ipynb Be able to answer any questions about the lab to show that you understood it.