Your *boss/professor* tells you to *find the largest number in a Python list* and present the result in front of the whole employees/classmates. Now there are some rules that you need to follow to impress your boss/professor. They should be able to see both the *documentation and code* in this presentation. You should *execute the code* too. You may use any *presentation tool* of your choice. Now, how would you be able to present your code and ace it at the same time?
The above scenario can be easily tackled with the help of RISE — a Jupyter Notebook plugin, which can convert your .ipynb
notebooks into a presentation (slideshow).
Don’t worry, I won’t let you go or leave confused without explaining these steps in a detailed manner. Stay tuned!
Let’s write the logic of “*find the largest number in a Python list*”. The logic for this will be really minimalistic and easy to understand. Let’s use the below-given algorithm to write the logic:
sort()
.# Create a list of values
listValues = [-1, 10, -100, -50, 2]
# Sorting the list
listValues.sort()
# Printing the last element
print("Largest element in the list is:", listValues[-1])
Largest element in the list is: 10
When you execute the above code you will be prompted by the largest number in the list.
In this step, you need to download and install Python, but keep in mind the latest version is always the best version. It would be associated with all the additional features and plug-ins, let’s get not very specific here.
For windows - Download here
Click here for the video
*Remember*: There might be a billion of ways to install all the below software, one might use docker, anaconda or, etc. But I wouldn’t be using any of those. Rather, I would follow the traditional methods which would be easy to understand and ace it. Also, in this tutorial, I would provide the installation commands for windows only, if you want to add any commands for other operating systems, comment section is all yours.
After downloading Python, navigate to the “*Scripts*” folder as shown below:
If you don’t know where to find “Scripts” use the below path, you will get it:
C:\Users\*username*\AppData\Local\Programs\Python\Python39\Scripts
There are two things that you need to take care of:
username
, in this case, differs. Please double-check this.AppData
, so in this case go to the top and click on View
, and check the box which says hidden items
.After navigating to the Scripts
folder. Open the path on your command prompt, or just press Ctrl+A and then type cmd
and then press Enter, you will be directly navigated to the command prompt from the *“Scripts”* path. Use the following command to install Jupyter Notebook from your command prompt.
pip install jupyter notebook
Wait till it is successfully installed. By the way, the next time you want to open Jupyter Notebook, please type jupyter notebook
to launch it. After opening the Jupyter Notebook to create a new Python notebook, on the right-hand top corner, click on the drop-down menu and then select Python 3 Notebook.
Click here for the video
After you have installed the Jupyter Notebook, the time has now come to install RISE. Just navigate to your command prompt and type in the below command to install it:
pip install RISE
If you need to read furthermore about RISE then there is no better place than the official docs given below:
Installing RISE will automatically enable the option on the toggle bar as shown below, which clearly says “*Enter/Exit RISE Slideshow*”. This indicates that you have successfully installed RISE on your device.
Lastly, when your Python code and the documentation is ready, it’s time to present it. To present it click on the same RISE button it will automatically open your code in a presentation mode, meaning like a slide show as shown below:
Now if you need to edit your slides, or change their “*Slide Type”, you need to navigate to “View — Cell Toolbar — Slideshow”. If you want to come out of this mode, select “None”* from the same dropdown.
Currently, there are 5 different types of slides as shown below, you can choose from them, go ahead and try it out.
*Note*: You can independently choose a different slide type for every cell. Thanks to RISE.
Click here for the video
You have reached the end of this article “*Presenting Python code using RISE*”. I hope you guys have learned a thing or two from this tutorial. Suggestions are always welcomed here. If you have/facing any issues during installations, comment down below. I will respond ASAP. Until then, nail your Python code presentations, show them who is the boss in presentations. Stay tuned for more updates. Have a nice day!