Getting set up with Python!

After learning Ruby and then JavaScript, I felt that I wanted a little deeper dive into a different language. I have heard of Python many times in the developer circles and found out that it is a language that can be used to work as a backend language. According to python.org, “Python is an interpreted, interactive, object-oriented programming language. It incorporates modules, exceptions, dynamic typing, very high level dynamic data types, and classes. It supports multiple programming paradigms beyond object-oriented programming, such as procedural and functional programming. Python combines remarkable power with very clear syntax.” The first step I would need is to learn how to get Python installed and set up. Hopefully this blog will serve as a little tutorial to get this done!

The first step is to go to python.org and go to the download section. Once downloaded and installed, how do I run a script and see it working? What I decided to do was open up vscode, which can be found at https://code.visualstudio.com/ and open up the terminal which is included. I am on a Mac so if I type in python in my terminal it will show an earlier version of python that I have installed. In order to show the current version I have, I have to type in python3. I can now type in certain commands like 2+2 and have the terminal output 4, but what if I want to learn variables and functions in python?

I first want to create a folder on my desktop called hello_world and then open that folder within vscode. In order to make a python file it has to have .py at the end of the file name. In this case I will create a file called main.py. In this file I will try to create my first python script and see what happens. In order to have a simple line of text print out I have to write the following code:

Now to run this script all I have to do is simply put python3 main.py in the terminal and there it is! This is a simple step in my journey with Python. I will now be moving into data types, operators, variables and much more!

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store