Skip to Content


You (Level 0)
0% Complete
Last Badge Earned
None

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.

Your code will execute in this window.



Let's explore some more tutorials or topics!

Previous Tutorial Next Tutorial



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

Comment on

  • User

    mtchabok June 30, 2015, 12:26 p.m.

    very good

  • User

    trrapp12 May 18, 2015, 6:39 a.m.

    comment

  • User

    EveeS May 17, 2015, 6:36 p.m.

    Confused

  • User

    liuxin May 17, 2015, 2:25 p.m.

    Python is powerful. It's nice and fun. 加油吧。

  • User

    John Snow May 12, 2015, 2:39 a.m.

    Print("Hello Programmers") Hello Programmers

  • User

    Boilerroom April 21, 2015, 5:37 p.m.

    Simple I want to learn as much as I possibly can....

  • User

    Michael April 14, 2015, 1:59 p.m.

    Nice and straight forward.

  • User

    fadrior March 20, 2015, 5:38 a.m.

    Suggestion: If you have any kind of control on the code simulator, it would make much more sense to have the result pane AFTER the coding pane. This to avoid scrolling up and down to check result. Thanks

  • User

    James Nguyen March 17, 2015, 6:13 a.m.

    Hello! I'm a newbie. Can anyone please explain for me what is the different if I use ' and "

  • User

    James Nguyen March 17, 2015, 6:13 a.m.

    Hello! I'm a newbie. Can anyone please explain for me what is the different if I use ' and "

  • User

    James Nguyen March 17, 2015, 6:13 a.m.

    Hello! I'm a newbie. Can anyone please explain for me what is the different if I use ' and "

  • User

    James Nguyen March 17, 2015, 6:12 a.m.

    Hello! I'm a newbie. Can anyone please explain for me what is the different if I use ' and "

  • User

    James Nguyen March 17, 2015, 6:12 a.m.

    Hello! I'm a newbie. Can anyone please explain for me what is the different if I use ' and "

  • User

    JustinOng March 9, 2015, 6:57 p.m.

    Hi guys!!! I am a newbie in programming!! ^_^'

  • User

    Lester Feb. 16, 2015, 3:58 a.m.

    print ("Im so handsome")

  • User

    Lester Feb. 16, 2015, 3:53 a.m.

    Im 17 years old from Philippines. Im new here and also in programming :) Hello guys :D

  • User

    mike Feb. 12, 2015, 5:06 a.m.

    I like your approach in teaching and explaining.

  • User

    beginner2014 Feb. 4, 2015, 3:29 p.m.

    Real easy to follow.

  • User

    jellybeard Jan. 31, 2015, 9:27 a.m.

    Hi, in IDLE I am only able to execute one statement at a time. This means that I am unable to complete this example. Is there a different IDE that I should be using?

  • User

    cheeki_breeki Jan. 5, 2015, 1:51 p.m.

    A nuu Cheeki Breeki iv Damke

  • User

    PapaJack Jan. 4, 2015, 9:28 p.m.

    Try this out.... a = ("My first Python code ") b = ("it's easier than I expected!") print(a+b) Notice the space after the word "code". Try without the space.

  • User

    2g8uy56902 Dec. 27, 2014, 4:04 a.m.

    It is so nice and fun!

  • User

    2g8uy56902 Dec. 27, 2014, 4:04 a.m.

    It is so nice and fun!

  • User

    Mze Dec. 21, 2014, 5:58 a.m.

    amazing

  • User

    Cr Dec. 15, 2014, 1:50 p.m.

    good

  • User

    Ishwor Kunwor Dec. 14, 2014, 7:26 p.m.

    I am being curious after I got It in first level

  • User

    Ishwor Kunwor Dec. 14, 2014, 7:26 p.m.

    I am being curious after I got It in first level

  • User

    Darshan Dec. 3, 2014, 8:59 a.m.

    Very well put. Appreciate the effort very much.

  • User

    Catbug Dec. 2, 2014, 4:04 p.m.

    cool

  • User

    RCG Nov. 28, 2014, 4:11 p.m.

    I am using Python 2.7.6 on my Ubuntu 14 machine. Will at least most of the commands be the same as 3.x? I am using Python IDLE to practice. When I type in 1 line of code and hit "enter" to move to the next line, it runs the line of code I wrote e.g. >>>print (" My first line of Python code!") My first line of Python code! >>>print ("easier than I expected") easier than I expected The same thing happens when I am running Python in the Terminal Window. How do I get to the next line without running the code? Is the only way to use a test editor?

  • User

    Zeke Nov. 24, 2014, 9:33 p.m.

    Try again Buddy

  • User

    cheeki_breeki Nov. 15, 2014, 1:59 p.m.

    i said come in, don't stand there

  • User

    Shizzle_MCnizzle Nov. 14, 2014, 1:27 p.m.

    The next day. i tried again. but this time. with C++. my sister and my dad came in at the same time ravageously. i jumped out the window. my life is now more ruined

  • User

    Juan Francisco López Nov. 6, 2014, 10:34 p.m.

    good

  • User

    I Never Asked For This Nov. 3, 2014, 12:01 p.m.

    Is gud

  • User

    gorkiboy Oct. 21, 2014, 1:03 a.m.

    print ("Oh my god I'm excited So easy, thanks !!")

  • User

    abdullah anisetty June 29, 2014, 9:07 a.m.

    print("best website to learn computer language") print("*_#")

  • User

    Clau Lacatus June 28, 2014, 1:53 a.m.

    Yeahoo!! The greatest teaching website for a newbie (like me)! :) Thanks to owner & colaborators!

  • User

    Alina June 17, 2014, 6:48 p.m.

    So far, so good.

  • User

    Xenobot June 17, 2014, 4:13 p.m.

    It's great so far!

  • User

    jared drake June 15, 2014, 11:56 a.m.

    this is really sick guys

  • User

    NoiselessFavre June 11, 2014, 9:50 p.m.

    oops. accidentally scrolled down too much

  • User

    NoiselessFavre June 11, 2014, 9:34 p.m.

    print ("my first python code!") print ("easier than I expected")

  • User

    Herf1 June 2, 2014, 3:54 p.m.

    Simple enough,though I was expecting as much.FUN

  • User

    Bob Evans May 28, 2014, 12:18 p.m.

    I like the whole print thing, though I keep forgetting the parentheses.

  • User

    Nazar May 22, 2014, 11:50 p.m.

    tutorialnya mantap

  • User

    Gaurav Kulkarni May 22, 2014, 10:02 p.m.

    Your python IDLE link is broken.. However this one here works out well.. https://www.python.org/download/ .. Very simple and explanatory tutorials.. great work!

  • User

    Luis Arce May 22, 2014, 10:58 a.m.

    I am excited to learn Python!

  • User

    haborym May 16, 2014, 7:56 p.m.

    Great and easy