When I first started on my coding journey, I wasn’t quite sure where to begin and I was quickly overwhelmed by the vast amount of resources and information available through a quick Google or YouTube search. This past week, I was helping a friend getting started with coding and it inspired me to make this tutorial. So if you are looking for a resource to begin coding in Python, you came to the right place. As a disclaimer, I will be using Windows for this walkthrough so if you are not using Windows, this tutorial might not as easy to follow.
This guide will be using software that is catered towards Data Science, however, whether or not that is your focus, I am going to help you set up an easy-to-use and intuitive environment (called an IDE) in which you can code in Python, regardless of future aspirations. An IDE (or Integrated Development Environment) is a program that is dedicated to software development. In laymen’s terms, an IDE is an environment where you type your code, run your code, and save your code (think of it like Microsoft Word to a Word Document). Additionally, good IDEs will provide you with tools to debug your code, highlight any issues in errors and allow you to quickly recall saved variables.
The software we will be using to code is the Jupyter Notebook from Project Jupyter. We are going to download this through a package called Anaconda. The package contains a bunch of good Data Science-y things in addition to Jupyter Notebook and Python. Here is the link provided below:
Anaconda | Individual Edition
Anaconda's open-source Individual Edition is the easiest way to perform Python/R data science and machine learning on a…
Once you’ve downloaded the installer, before hammering through all the recommended settings when going through the installer, let me bring your attention to one feature you want to be sure to check:
Once you’ve finished installation, the goal is to launch the Anaconda Navigator. This can be easily found from the Windows start menu:
Launching the application will open up a window as shown below. From this menu, you can select the Launch button for the Jupyter Notebook:
Once you launch the notebook, it should open a window using your browser. To open a new notebook where your coding will be done, select the “New” markdown and then select Python 3 as shown in the image below:
This will create a new notebook file in which you can start playing around to learn how to code.
As shown above, the print(“Hello World!”) is written in a cell. You can follow along by typing this into the first cell and then hitting Shift+Enter or the Run button to run the code in that specific cell. When you run a cell and have no other cells, a new cell will automatically populate below the cell you ran. You can also press the ‘+’ button to add new cells as circled in red below:
The Jupyter Notebook will autosave your work every so often but you can save your work using the floppy disk icon located next to the ‘+’ shown above. Whenever you are done coding, make sure to save your work and you can close the according web browsers.
When you want to access your notebooks again, reopen Jupyter Notebook from the Anaconda Navigator and locate your file. Simply click the file to open it.
There you have it, you are now ready to begin coding in Python. Don’t be afraid to mess around and have fun learning Python!
To continue the journey, be sure to check out my next post which teaches the very basics to writing code in Python 3: