Calculations Workout
- 01:43
How to use the Jupiter notebook file, including performing calculations and displaying results using the print function. As well as how to use spaces and indentation in Python code.
Downloads
No associated resources to download.
Glossary
Calculations Coding Jupyter Notebook Print PythonTranscript
For your first exercise, go to the code cell in your Jupyter Notebook file and perform the following calculations and display all of the results using the print function.
In the cell block below exercise 2.1 let's go ahead and write out our code.
So you might be wondering why I have these spaces within the parentheses and between these operators and in Python the spaces don't matter for the way that the code is executed, it's strictly for formatting. So for me, I like to have plenty of space in between just because I think it's a little bit easier to read instead of having everything all tight, especially when your formulas get a little bit longer. Sometimes I'll do things like, you know, if I'm, if I know or of operations is gonna make that happen before this, then I might space it out just to make that more clear. But that's totally up to you. You can use spaces however you want. The only difference is when you use an indentation that changes the way that Python reads, reads your code. But that's not important right now. For now, just for 2.1, this is the code that you're gonna wanna run and there are our answers.