Getting Started with Python

The Basics

If you’ve discovered this page, you are most likely taking a programming class or you’re interested in data science and machine learning. However, Python is a multi-purpose language that can be applied to many different sectors including but not limited to game-design, block-chain, web-applications, business, and general software development. It’s powerful, versatile, and and well documented. The goal of this blog is to supplement your python programming knowledge and give you examples to help with homework and projects.

Today’s agenda will consist of:

  • History of Python and Python Today
  • Python Installation
  • Syntax

History and Today

Python was first developed in the 1980s by Guido van Rossum of the Netherlands. It was developed as the successor to the ABC programming language. Implementation began in 1989. From then till now it has released Python V1, 2, and 3 as well as their sub versions. Today, Python is one if not the most valuable programming language to learn mostly due to the increasing popularity of data science as well as it’s easy to read syntax.

Installing Python

Python is relatively easy to install on both Windows and Mac. First, head over to https://www.python.org/downloads/ and download the correct installer and version for your system. Once you finish going through the installer steps, the python interpreter will be ready to be used on your system. From there, you can create .py files with Idle (the default python code editor) and run them on the interpreter. Additionally you can install PyCharm IDE for general programming and Anaconda for data science.

Your First Python Program

At this point you’ve downloaded Python and you’re ready to build a custom random forest classifier right? No? Well in that case we’ll need to learn some very basic Python syntax. Here are some essential basics for every python programmer to understand.

  • Indentation is extremely important in Python because it determines scope (or when a new part of the program begins)
  • Variables are declared with a name, the assignment operator (=), and a value (a “string”, an integer 6, or a float 5.668) ex. thisIsAVariable = “variablename”
  • the print() method is the way to produce output from the python console

Homework:

  1. Create a variable in your IDE or IDLE with a string, int, or float datatype
  2. Print it out using the print method
ex.
hello = "hello world!"
print(hello)

Leave a Reply

%d bloggers like this: