-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodules.py
More file actions
50 lines (28 loc) · 761 Bytes
/
modules.py
File metadata and controls
50 lines (28 loc) · 761 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import math
from math import sqrt
# print(sqrt(49))
# print(math.sqrt(49))
import tryalgo
# help(tryalgo) list of modules
# help(tryalgo.arithm) for a particular module
# err
# c = {}
# c['a'] += 1 the key does not exist
# print(c) err
# corr
# c['a'] = 1
# c['a'] += 1 now it does
# c['a'] += 3
# print(c) value correct
from collections import Counter
# c = Counter()
# c['a'] += 1 the key does not exist, so it so created
#print(c)
# c = Counter('cowboy bebop')
# print(c)
from collections import defaultdict
g = defaultdict(list)
g['paris'].append('marseille') # 'paris' key is created
g['paris'].append('lion')
print(g)
print(g['paris'])