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.

Try testing your code with the code simulator!

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
YoukF
100
September 21, 2014 08:28AM
How is it that you get points here?


user
Russell Campolongo
September 21, 2014 02:09AM
</br><a href="http://www.femalecoalition.com
">Russell Campolongo</a></br>[url=http://www.femalecoalition.com
]Russell Campolongo[/url]


user
RONOLOFLOFTHECYBORG
September 18, 2014 01:27AM
IM THE CYBORG FROM THE FUTURE AND I CAME TO TEACH HUMANS HOW TO FART TWICE AT THE SAME TIME WITH PYTON


user
ronan
September 17, 2014 05:28AM
ronans sooo gay


user
james ueirhje
September 17, 2014 05:27AM
stfuIM A CYBOR FROM CYBORGOLAND
YOU DISGRACEFULL HUMAMS STFU AND LEARN PYTON bens dry


user
CYBORGONAUTO
September 17, 2014 05:26AM
IM A CYBOR FROM CYBORGOLAND
YOU DISGRACEFULL HUMAMS STFU AND LEARN PYTON


user
luckluckluck
125
September 16, 2014 10:16AM
http://www.python.org/getit/ - 404 error :(


user
diana
September 16, 2014 12:36AM
..................


user
Sean Cotton
25
September 15, 2014 07:54PM
What does the badge test your code mean?  What code am I testing?


user
Robert Nikolovski
September 14, 2014 06:30PM
It is good for beginners just like me. :D


user
yo yo
September 11, 2014 10:01PM
this is not so great jks it's the bomb


user
tamil selvan
September 10, 2014 08:39AM
SyntaxError: invalid syntax
>>> print "hello"
  File "<stdin>", line 1
    print "hello"
                ^


user
Alinawaz Mamdani
September 4, 2014 01:35AM
it is
Kinda bad.                                          


user
Peter Jaenicke
125
September 2, 2014 01:16PM
Python IDLE link is broken on this page.


user
David K Hill
100
September 1, 2014 02:22AM
The Python IDLE link is broken:  404 Error.
http://www.python.org/getit/


user
henry
August 26, 2014 10:01PM
Sorry I forgot to add I hooked up a thermomiter and I want to pi to recive the temp and send it to my computer screen along with the live streaming video.   Ps I'm running python


user
henry
August 26, 2014 09:57PM
Hi I'm brand new to programing and I need some help I justbought.  A rasberry pi a RC car and I want to insert the pi into the car PS I kow how to hook it up but idk how to get it to recive the tempeture and send it to the camera I hooked up to the car it is streaming everything the car is in front of I want to see the temp on the screen. Thanks.      


user
Lonnie Laver
August 25, 2014 06:45AM
</br><a href="http://www.individualdirectory.com
">Lonnie Laver</a></br>[url=http://www.individualdirectory.com
]Lonnie Laver[/url]


user
yusuff
August 23, 2014 08:18PM
this program is great remind me of data processing i took in hs back in 1988


user
Miriam
100
August 19, 2014 08:32PM
I came back after a few days of trying the tutorials, and now I can't find the spot where I left off, I want to advance to the next tutorial but the button is gone


user
ilianna
August 19, 2014 04:47PM
i love this its super rad im pumped to get in to it 


user
mrobbins
75
August 18, 2014 08:25PM
Idle download is "not found".


user
James lee
August 15, 2014 06:14AM
It is ok.                                                                                                                                                           


user
CodeLikeJesus
75
August 13, 2014 08:23AM
This was great man


user
Skully
150
August 12, 2014 01:37PM
Very nice !


user
chandima
August 11, 2014 12:50AM
good nice to beggin a programming language


user
john smith
100
August 8, 2014 01:04AM
this is enjoyable                                              


user
Katie
August 6, 2014 02:10PM
This is fun!


user
Michal
75
August 5, 2014 11:42AM
Do I have to comment each time?


user
J12345
August 4, 2014 12:11AM
Do I have to comment each time?