Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Some Fuctions And What They Do
#1
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
Reply
#2
I think you should explain the difference between input and raw_input.
Nice, anyways.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [TUT] Python Tutorial, Learn To Make Many Different Projects And Fuctions! nevets04 3 2,068 10-26-2009, 04:37 PM
Last Post: nevets04

Forum Jump:


Users browsing this thread: 1 Guest(s)