The goal of this assignment is to get acquainted with Python using Jupyter Notebooks.
You will be doing your work in a Jupyter notebook for this assignment. You may choose to work on this assignment on a hosted environment (e.g. tiger or Google Colab) or on your own local installation of Jupyter and Python. You should use Python 3.8 or higher for your work. To use tiger, use the credentials you received. For Colab, you will need to use a Google account. If you work remotely, make sure to download the .ipynb file to turn in. If you choose to work locally, Anaconda is the easiest way to install and manage Python. If you work locally, you may launch Jupyter Lab either from the Navigator application or via the command-line as jupyter-lab
.
The assignment is due at 11:59pm on Thursday, January 21.
You should submit the completed notebook file required for this assignment on Blackboard. The filename of the notebook should be a1.ipynb
.
Please make sure to follow instructions to receive full credit. Use a markdown cell to Label each part of the assignment with the number of the section you are completing. You may put the code for each part into one or more cells.
The first cell of your notebook should be a markdown cell with a line for your name and a line for your Z-ID. If you wish to add other information (the assignment name, a description of the assignment), you may do so after these two lines.
Write code that prints “Hello, World” but split into two lines like the following
Hello,
World
<name>
(5 pts)Write code that prompts the user for their name, and prints Hello, <name>
where <name>
is the name they enter. Use the input
function for this.
Write code that defines four variables (acceleration (a
), initial velocity (v0
), initial position (x0
), and time (t
) and computes the final position (x
) according to the equation below. \[
x = x_{0} + v_{0} t + (1/2)at^2
\] Your code should work for any values, but you should finish by setting the values of a
, v0
, x0
, and t
to -9.8
, 20
, 500
, and 12
, respectively. Output the value of x
.
Write code that defines three variables (acceleration (a
), initial velocity (v0
), initial position (x0
)) and requests and captures a fourth variable (current position (x
)) from user input. Then, compute the current velocity according to the equation below. \[
v = \pm \sqrt{v^2_0 + 2a(x - x_0)}
\] Without using a print statement, output the value of v
with “+/-” prefixed to it. Your code should work for any values, but you should finish by setting the values of a
, v0
, x0
, and x
to -9.8
, 20
, 500
, and 35
, respectively.