This is a draft cheat sheet. It is a work in progress and is not finished yet.
Comment
#comment |
""" doctring """ |
communicating
printting & fromatting |
print "my value: %s" % value |
asking for value |
foo = raw_input() |
|
|
Fonction
def foo(args) :
print "fonction"
return val
|
dictionnire, liste
list = [a,b,c] |
dict = {'x': y, 'a': b} |
|
|
structure
if |
for x in y : |
while foo : |
elif |
else |
Modules, Classes, and Objects
class Song(object):
def __init__(self, lyrics):
self.lyrics = lyrics
def sing_me_a_song(self):
for line in self.lyrics:
print line
|
|
|
|