1
0
Fork 0

Merge remote-tracking branch 'origin/master'

This commit is contained in:
s407531 2018-06-03 11:11:49 +02:00
commit 0b1808ca5a
6 changed files with 55 additions and 6 deletions

View File

@ -10,7 +10,15 @@ ma być zwracany napis "It's not a Big 'No!'".
"""
def big_no(n):
pass
if n<5:
zdanie="It's not a Big 'No!'"
else:
zdanie='N'
for i in range(n):
zdanie=zdanie + 'O'
zdanie = zdanie+'!'
return zdanie
def tests(f):
inputs = [[5], [6], [2]]

View File

@ -7,7 +7,13 @@ przez 3 lub 5 mniejszych niż n.
"""
def sum_div35(n):
pass
suma = 0
for i in range(n-1):
if (i%3==0) or (i%5==0):
suma = suma + i
return suma
def tests(f):
inputs = [[10], [100], [3845]]

View File

@ -9,7 +9,8 @@ Np. leet('leet') powinno zwrócić '1337'.
def leet_speak(text):
pass
return tekst.replace('o', '0').replace('l', '1').replace('e', '3').replace('t', '7')
def tests(f):

View File

@ -7,10 +7,17 @@ Napisz funkcję pokemon_speak, która zamienia w podanym napisie co drugą liter
na wielką. Np. pokemon_speak('pokemon') powinno zwrócić 'PoKeMoN'.
"""
def pokemon_speak(text):
pass
listy = []
for i in range(len(text)):
if i % 2 == 0:
listy.append(text[i].upper())
else:
listy.append(text[i])
return ''.join(listy)
def tests(f):
inputs = [['pokemon'], ['do not want'], ['POKEMON']]

View File

@ -8,8 +8,14 @@ uporządkowaną listę wspólnych liter z lańcuchów string1 i string2.
Oba napisy będą składać się wyłacznie z małych liter.
"""
def common_chars(string1, string2):
pass
s=string1.replace(' ','')
t=string2.replace(' ','')
s=set(s)
t=set(t)
zwracam = sorted(s & t)
return list(''.join(zwracam))
def tests(f):

21
labs04/Zadanie 5 Normal file
View File

@ -0,0 +1,21 @@
import glob
sciezka = 'scores/*.npz.bleu'
for plik in glob.glob(sciezka):
with open(plik, 'r') as f:
for linia in f.readlines():
numer = float(linia[linia.find("=") + 1:linia.find(",")])
if numer > 0:
max_numer = numer
max_numer_plik = plik
f.close()
print(max_numer_plik)