mat = [
[1, 2, 3],
[4, 5, 6],
[7, 8, 9]
]
print ([[row[i] for row in mat] for i in [0, 1, 2]])
list(zip(*mat))
del(mat[0])
print mat
t = 12345, 54321, 'Hello'
print t
u = t, (1, 2, 3, 4, 5)
print u
tel = {'jack': 4098, 'sape': 4139}
tel['guido'] = 4127
print tel
print tel['guido']
print list(tel.keys())
print 'jack' in tel
print [x + "aho" for x in tel]
d = dict([('sape', 4139), ('guido', 4127), ('jack', 4098)])
print sorted(d.values())
print {x: x*2 for x in (2, 4, 6)}
print dict(a="b", b="c", c="d")
for name, number in tel.items():
print name, number
for idx, name in enumerate(tel):
print idx, name
questions = ['Name', 'Quest', 'Favorite Color']
answers = ['Tany', 'RPGVXAce', 'Orange']
for q, a in zip(questions, answers):
print('What is your {0}? It is {1}.'.format(q, a))
print ("---sorted---")
for name in sorted(tel):
print name
print("---tupple---")
print (1, 2, 3) < (1, 2, 4)
print('---list_and_tupple---')
print [1, 2, 3] < (1, 2, 3)