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
Joni Hamerpagt
25
April 8, 2014 07:58AM
I'm loving this also allready


user
Bhupesh
April 4, 2014 11:47PM
Good place to learn python 


user
J Pallitta
100
April 3, 2014 04:08PM
Test Code is not working!


user
rakesh nair
April 1, 2014 04:26PM
python is brilliant!!!!


user
Freezeal
100
March 31, 2014 01:13PM
I am so loving this!


user
Derpelganger
March 14, 2014 07:19PM
I typed in the 4 spaces in the code simulator and It wouldn't take my code.  So why or where do I put the spaces?


user
ahmed god
March 13, 2014 05:21PM
programing is the best, especially with python
 


user
Tony Syracuse
March 13, 2014 10:34AM
link to IDLE doesn't work.


user
brbrett
150
March 11, 2014 10:13PM
So far so good.


user
Alex Hernandez
75
March 9, 2014 10:32PM
Whoa! I Love Python!


user
Trojan
March 8, 2014 11:30AM
thanks for the help, but why must the comment be over 25 characters? xXx


user
prashant mangla
March 3, 2014 02:58AM
how to execute programming on python in windows 7 ?


user
Achala
February 26, 2014 09:02PM
informative tutorial guys


user
Brett Knighton
February 26, 2014 07:23PM
this is  an awesome program and tutorial for beginners 


user
Brett Knighton
February 26, 2014 07:21PM
this is awesome


user
Lotfi GHAZOUANI
200
February 25, 2014 12:19PM
Nice first step, many thanks for this good job.


user
Kumar
75
February 24, 2014 12:24AM
its really to beginners.... thanks to development team...


user
Fahmida Hamid
February 20, 2014 11:30PM
good to start..............................................


user
davin
February 13, 2014 12:42AM
Thank you for creating this site. Great tutorials, i have searched for quite a while to find a tutorial that is aimed at beginners,


user
webspiderls
25
February 9, 2014 05:50AM
Great Tutorials. 


user
Vic Roberts
50
February 5, 2014 06:49AM
Great tutorials, i have searched for quite a while to find a tutorial that is aimed at beginners, most assume you have some programming knowledge and seem to get you lost but this one is much more straight forward. Keep up the good work.


user
zeemkqx
25
February 4, 2014 02:25PM
I look forward on seeing more, very interested in this!


user
Alinawaz Mamdani
February 3, 2014 03:26AM
Y u delete my last comment! I will report you to the NSA


user
marlon
75
January 30, 2014 07:18PM
Hi I have the same issue like Aeron.
For some reason the lines on my shell are not numbered it simply has ">>>"; can someone help me figure it out please? 


user
Starter
January 28, 2014 03:30AM
Hi, the tutorial is mostly good, but if it is for absolute beginners why are you using phrases like "Python is more commonly used as a module rather than intertwined like some PHP or ColdFusion" on p 25. which means nothing to a beginner. 


user
Tigerlilies
January 20, 2014 09:55AM
Seems like a very straight forward tutorial. Would like to see what the next sections look like. :) 


user
john smith
January 19, 2014 06:30PM
Thank you for creating this site.  It's difficult to find bare bones programming tutorials.  After hello world, most sites assume you understand all the concepts


user
Gilberto Villarreal
January 16, 2014 12:35PM
I am a 65 year older beginner at trying to learn programming


user
mohd22
January 7, 2014 06:57PM
Not bad , let's see how the next tutorials will look like


user
Aeron
January 2, 2014 10:06AM
For some reason the lines on my shell are not numbered it simply has ">>>"; can someone help me figure it out?