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


Messages In This Thread
Some Fuctions And What They Do - by nevets04 - 10-17-2009, 10:09 PM
RE: Some Fuctions And What They Do - by L0iz - 10-18-2009, 03:14 AM

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: 2 Guest(s)