done
This commit is contained in:
parent
e1c9346baa
commit
a946cb82da
@ -10,7 +10,7 @@ def sum_from_one_to_n(n):
|
||||
suma = 0
|
||||
|
||||
for i in range(n+1):
|
||||
suma = suma + i
|
||||
suma = suma + i
|
||||
if n < 1:
|
||||
return 0
|
||||
else:
|
||||
|
@ -8,9 +8,10 @@ dwoma punktami przestrzeni trójwymiarowej. Punkty są dane jako
|
||||
trzyelementowe listy liczb zmiennoprzecinkowych.
|
||||
np. odległość pomiędzy punktami (0, 0, 0) i (3, 4, 0) jest równa 5.
|
||||
"""
|
||||
|
||||
from math import sqrt
|
||||
def euclidean_distance(x, y):
|
||||
pass
|
||||
|
||||
return sqrt(sum((x - y) ** 2 for x, y in zip(x, y)))
|
||||
|
||||
def tests(f):
|
||||
inputs = [[(2.3, 4.3, -7.5), (2.3, 8.5, -7.5)]]
|
||||
|
@ -13,7 +13,7 @@ def pokemon_speak(text):
|
||||
|
||||
|
||||
def tests(f):
|
||||
inputs = [['pokemon'], ['do not want'], 'POKEMON']
|
||||
inputs = [['pokemon'], ['do not want'], ['POKEMON']]
|
||||
outputs = ['PoKeMoN', 'Do nOt wAnT', 'POKEMON']
|
||||
|
||||
for input, output in zip(inputs, outputs):
|
||||
|
Loading…
Reference in New Issue
Block a user