10-17-2009, 10:09 PM
open("file.txt", "w")
Opens a file with text reading to be written to it Common use: x = open("file.txt", "w")
raw_input("Text")
Takes input from user. Common use: x = raw_input("")
x.write(Text)
Write text to what ever file x opens. Commonly used with: x = open("file.txt", "w")
input("Text")
Takes input from user. Common use: x = input("")
print "Text"
Displays text
+, -, *, /
Addition, Subtraction, Multiplication, Division
Import module
imports a module. Common Use: import random
random.choice(a)
Choose a random quote or variable from a string. Commonly used with a = ['1','2']
range(a,b,c)
Displays numbers a through b counting by c. Common use for i in range(y,z,x):
/n
Makes a new line
os.system("clear")
Clears the terminal. Commonly used with: import os
Opens a file with text reading to be written to it Common use: x = open("file.txt", "w")
raw_input("Text")
Takes input from user. Common use: x = raw_input("")
x.write(Text)
Write text to what ever file x opens. Commonly used with: x = open("file.txt", "w")
input("Text")
Takes input from user. Common use: x = input("")
print "Text"
Displays text
+, -, *, /
Addition, Subtraction, Multiplication, Division
Import module
imports a module. Common Use: import random
random.choice(a)
Choose a random quote or variable from a string. Commonly used with a = ['1','2']
range(a,b,c)
Displays numbers a through b counting by c. Common use for i in range(y,z,x):
/n
Makes a new line
os.system("clear")
Clears the terminal. Commonly used with: import os