This tutorial is directed to people learning python, and that already have python installed on their computer and know how to execute a script. If you don't, download python from python.org. If you are on Linux or mac, you should already have python and to execute the script you made in text edit and saved as a .py, go into terminal and type
The Print Command:
This simple but useful function displays text on the screen
This will display:
Variables:
Used to store information, variables can be very helpful
a now equals "hello", so when you
You will see
raw_input:
This function is used to take input from the user of your program
This will display
This will display
Your first python script:
putting everything you just learned together we will make our first script
Code:
python scriptname.py
The Print Command:
This simple but useful function displays text on the screen
Code:
print "Hello there"
Quote:Hello there
Variables:
Used to store information, variables can be very helpful
Code:
a = "hello"
Code:
print a
Quote:hello
raw_input:
This function is used to take input from the user of your program
Code:
raw_input("Type Something: ")
Quote:Type Something:This function isn't very useful without it meaning something, so to do this we will allow a variable to store the information the user inputs
Code:
x = raw_input("Type Something: ")
Quote:Type Something:This may look the same, however, adding the "x =" makes whatever the user types equal to x
Your first python script:
putting everything you just learned together we will make our first script
Code:
x = raw_input("Type Something: ")
print x