Newest Visitor Badge Earned!
Click to create an account and start competing today!
After Hours Programming
Show Tutorials

You (Level 0)
0/25
Last Badge Earned
Newest Visitor

Python Introduction Tutorial

Python Introduction

The Python Introduction tutorial explains how and where to start writing Python for the server side.

First, off Python usually requires some setup by downloading the Python IDLE. The Python IDLE is basically a text editor that lets you execute Python code. If you want to use Python as a server-side language, you certainly can. Python can output HTML just like other languages can, but Python is more commonly used as a module rather than intertwined like some PHP or ColdFusion. As for right now, I recommend you download the IDLE to help you debug your code while we learn the fundamentals offline. One really quick note, we are using python 3.2. Before we go to an example, please understand that Python is space sensitive. This means you must have 4 spaces for each indentation every single time. We'll get into this more later, now let's go to an example.

Example print ("My first Python code!")
print ("easier than I expected")
Result My first Python Code!
easier than I expected

You can see right off the bat, that we use print() a whole lot. Basically, all it does is output whatever is inside the parentheses. You will be doing lots of printing so, you can get more comfortable with it as we go. Print is a function that we will go into later, but just understand that it can take a value. On the first line, we provide a string value "My first Python code!", which is a string because of the quotes. So, you just told Python to output that string to the console. Python completes that task and moves onto the next line where it prints out a different string.

See how simple that was? Well, get used to it. Python is probably one of the simplest looking languages that can do some of the most powerful things you can imagine. You can see from the example how clean Python's syntax is without all of the extra stuff that other languages add. That covers the easiest Python statement you will ever write. In the following sections, we will be using more advanced functions and teaching you the fundamentals of Python.

Let's move on to some more tutorials or the next section!

Previous Tutorial

Overview

Next Tutorial

Comments








If you enjoyed this resource, support me by sharing this page with others.

Stumbleupon Facebook Twitter GooglePlus Reddit Delicious Digg


Comment or Suggestion?

Comments are a way to tell me about corrections or suggestions, what you thought about the resource, or providing additional information. Help feed the discussion!


Yes


Comments on Python Introduction

user
sirius
75
May 19, 2013 05:38AM
Hello,
Very simple tutorial and very instructive
Thanks a lot.


user
Skinner Sweet
75
May 3, 2013 02:34PM
LOL Kayle O.


user
Mark Donaldson
April 30, 2013 06:30PM
As my only education in programming is Basic and Pascal I was relieved to see the most basic functions like variables,looping,IF statement are mostly the same.MY only criticism is that as things went on the examples would have multiple changes and it got to where I couldn't really follow it. A list of RESERVED WORDS with a brief explanation of what they do would help. I wish I was a genius like you but I have to take the Edison approach to this...90% perspiration. IN all I found this to be a great overview of these topics and I hope to find something a bit more detailed with more examples.


user
Kayle O.
April 11, 2013 11:49PM
Hmm odd to have the first things you print not be "Hello World".
You may have incurred the wrath of the computer gods.


user
Savdeep Singh
25
March 12, 2013 11:37PM
awesome tuts


user
julio breitkreitz
March 8, 2013 04:36PM
it helps me, thank you for the lessons.