Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python Tutorial For Begginers
#1
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
Code:
python scriptname.py

The Print Command:
This simple but useful function displays text on the screen
Code:
print "Hello there"
This will display:
Quote:Hello there

Variables:
Used to store information, variables can be very helpful
Code:
a = "hello"
a now equals "hello", so when you
Code:
print a
You will see
Quote:hello

raw_input:
This function is used to take input from the user of your program
Code:
raw_input("Type Something: ")
This will display
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: ")
This will display
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
Reply
#2
The most simple, but best python tutorial I've seen here Smile.
Reply
#3
Nice work.
Your a quick learner with Python Smile
Confused
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  (★ Dяea Tutorials ★ )-==-[ DataBases in Python ]-==-(★Tutorial no.1★) Dяea 17 4,988 09-30-2019, 01:00 AM
Last Post: samsmith001
  Python Help Dεlluzion 3 2,003 09-30-2019, 12:59 AM
Last Post: samsmith001
  Python tutorial websites for beginners BigdaddyV 6 2,005 04-08-2012, 11:15 AM
Last Post: Mysterious
  Simple Python Python Compiler Canoris 21 9,173 06-01-2011, 06:30 PM
Last Post: Filefinder
  Python 2 vs 3? Jake 8 2,661 12-11-2010, 04:13 PM
Last Post: Bursihido

Forum Jump:


Users browsing this thread: 1 Guest(s)