Пример #1
0
raw_input('press enter to end this script')
# watch this again!! - this codes the guessing game with user input
http://www.youtube.com/watch?v=0ury8KHQdL4




import random
random.randrange(highest_num)

main.py should be the name of your main file that imports other things

import PH

for i in range(10):
	PH.printHam()
---------------------

# constructor - a function that is called when the instance is created
# watch this one again! http://www.youtube.com/watch?v=trOZBgZ8F_c
# Let's Learn Python - Basics #8 of 8 - Classes

way of packaging vars and funcs together

attributes: health, etc
actions: run, cry, etc

class Test:
	pass

x = Test()			# creates an instance of the class
Пример #2
0
import PH

for i in range(10):
	PH.printMe()