Thursday, October 16, 2014

Introduction to Python

An intro to the Python programming language

What is Python?

The Python programming language is a general programming language that can be used for many different purposes. Unlike C++ or Java, python is quick to set up and useful for teaching neophytes how to program. Python emphasizes readability instead of terseness. So, how exactly can we run a Python program?

Running a Python program

You can do one of two things: Download a python interpreter or use an online python interpreter. If you wish to do the former, you are on your own. However, if you want to do the latter then you can use Code Academy labs to run your python programs.

http://labs.codecademy.com

Click on the link above and select python. You should get a screen that looks something like this




Printing strings to the terminal

Now, the most basic program that we can create is a "Hello World"
type program. Now, on the left side of the screen put the following code:

print("Hello, World!")

Then click run. You should get the words Hello, World! on the right side of the screen.

In my next tutorial I will talk about how to get basic input from the user.


 

No comments:

Post a Comment