-
Notifications
You must be signed in to change notification settings - Fork 0
/
findIdent2.py
69 lines (55 loc) · 1.15 KB
/
findIdent2.py
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
a1 = [1, 2, 3, 2, 2, 7]
print a1[1:len(a1)]
print a1[2:len(a1)]
print a1[3:len(a1)]
for i in range(0, len(a1)):
print i, a1[i]
def blah1():
for i in range(0, len(a1)):
# print a1[i:len(a1)]
for e in a1[i:len(a1)]:
print e
if a1[i] == e:
print a1[i]
a1 = [1, 2, 3, 2, 2, 7]
def blah2():
for i in range(0, len(a1)):
# print a1[i:len(a1)]
cc=0
for e in a1[i:len(a1)]:
#print e
if a1[i] == e:
cc+=1
print a1[i], cc
#blah2()
a1 = [1, 2, 3, 2, 2, 7, 5, 7]
m={}
def blah2():
for i in range(0, len(a1)):
# print a1[i:len(a1)]
cc=0
for e in a1[i:len(a1)]:
#print e
if a1[i] == e:
cc+=1
print a1[i], cc
#blah2()
a1 = [1, 2, 3, 2, 2, 7, 5, 7]
m={}
def blah3():
for e1 in a1:
m[e1]=0
for e2 in a1:
if e1 == e2:
if (m[e1]):
m[e1]+=1
else:
m[e1]=1
blah3()
print a1
print m
#a = [1, 2, 3, 2, 5]
#print a
#a.remove(2)
#a.remove(2)
#print a