Professional Documents
Culture Documents
1 Lab 01 - Assignment
1 Lab 01 - Assignment
1 Lab 01 - Assignment
Hello Everyone! Welcome to your first lab :)
Goal: Today we are going to learn about using Jupyter Hub and Jupyter Notebook and how we
can use them to write line of codes in Python.
Let’s get started!
Let’s begin by writing a simple code to convert Celcius to Farenheit.
To do so we need to know the formula for this. Let’s search Google and type in “Convert celcius
to farenheit”.
Hint: The website that we are looking for is http://www.mathisfun.com/measure/thermometer.html.
1.1 TASK 1
Now that we have the formula we need to create two variables to store our data.
• Create a variable celcius and assignt temperature of 20.5 to it
[4]: # Your solution here
• Now we need another variable farenhiet to store the temperature in farenheit, but this time
instead of a value we need to assign an expression (using the conversion formula)
1
• Let’s try this! Uncomment (remove the # symbol) the code and run it
1.2 TASK 2
• Rewrite your code using the input function above:
[3]: #Your task solution goes here
[ ]: #Name = 'Rachel'
#print('Hi there', name)
#subtotal = 19.99
#tax = 1.13 * 19.99
#total = subtotal + tax
#print('your total is:', total)
The error you got is called “NameError” written in bold red on top. And also the debugger is
pointing to the line where the problem lies. you can use this information to fix the problem. This
is also called a ‘syntax error’. # Note here, Python is case sensitive. - What does it mean? It
means that the way you type th name of your variables matters. For example:
myVar = 9 #this spells with a upper case letter V
myvar = 0 #this spells with a lower case letter v
This spelling difference makes them two different variables!
1.3 TASK 3
• Now given this information, copy the code here, edit it to fix the error and try to run it again.
[2]: # You TASK solution goes here
2
1.3.1 How to submit your assignment
1. Deadline: 1 week from your lab session
2. To submit follow instructions on the how-to-submit tutorial file.