1
0
forked from tdwojak/Python2018

zad 4, 8, 9

This commit is contained in:
Ola Piechowiak 2018-05-20 16:53:37 +02:00
parent ebdd1865c9
commit acf48c8e1e
3 changed files with 11 additions and 5 deletions

View File

@ -10,9 +10,7 @@ def sum_from_one_to_n(n):
if n<1:
return 0
else:
for i in range(n+1):
sum += i
return sum
return sum(range(1,n+1))
def tests(f):
inputs = [[999], [-100]]

View File

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

View File

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