forked from tdwojak/Python2017
commit
This commit is contained in:
parent
fdc76696c9
commit
4f878a9849
7
labs03/task02.py
Normal file
7
labs03/task02.py
Normal file
@ -0,0 +1,7 @@
|
||||
def f(n):
|
||||
a,b = 1,1
|
||||
for i in range(n-1):
|
||||
a,b = b,a+b
|
||||
return a
|
||||
|
||||
print(f(55))
|
17
labs03/task05.py
Normal file
17
labs03/task05.py
Normal file
@ -0,0 +1,17 @@
|
||||
import glob
|
||||
|
||||
path = 'scores/model.iter*.npz.bleu'
|
||||
|
||||
for file in glob(path):
|
||||
with open(file, 'r') as f:
|
||||
for line in f.readlines():
|
||||
num = float(line[line.find("=")+1:line.find(",")])
|
||||
|
||||
if num > 0:
|
||||
max_num = num
|
||||
max_num_file = file
|
||||
|
||||
file.close()
|
||||
|
||||
print(max_num_file)
|
||||
|
Loading…
Reference in New Issue
Block a user