-
Notifications
You must be signed in to change notification settings - Fork 0
/
Luke7.py
48 lines (43 loc) · 1.07 KB
/
Luke7.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
import urllib.request
listelista = {}
print(listelista)
#print(len(listelista))
#print(listelista[0])
count = 0
def leggtilsombarn(tallet):
for n in sorted(list(listelista.keys())):
if tallet < n:
return
else:
#listelista.get(n).append(tallet)
listelista[n] += 1
for n in open("input/luke7.txt"):
#ta alle keys
#sorter dem
#legg til i alle under current
#hent lengde på lengste liste.
leggtilsombarn(n)
#listelista.update({n:[0]})
listelista.update({n:1})
if count%50000 == 0:
print(n.strip() , "\t", count)
with open('somefile.txt', 'a') as the_file:
the_file.write(str(listelista))
count+=1
longest = 0
for n in listelista.keys():
if longest < listelista[n]:
longest = listelista[n]
#print(n, listelista[n])
print(longest)
'''
if int(n) > listelista[outin][inin]:
inin +=1
listelista[outin].append(int(n))
else:
inin = 0
outin +=1
listelista.append([int(n)])
for n in listelista:
print(n)
'''