2.1.2.Python crash course
String
print('My number is: {one}, and my name is: {two}, more {one}'.format(one=num,two=name))List, Tuple, Dictionary, Set
l = [1,2,3] item = l.pop() l.append('new') 'x' in ['x', 'y', 'z'] //return True x = [(1, 2), (3, 4), (5, 6)] for a, b in x: print(a) print(b)
t = (1,2,3)
d = {'key1':'item1','key2':'item2'} d.keys() d.items() d.values()
In : {1,2,3,1,2,1,2,3,3,3,3,2,2,2,1,1,2} Out: {1, 2, 3}
Function
Map
lambda expressions
filter
Last updated