1
0
forked from tdwojak/Python2017
This commit is contained in:
s45147 2017-11-19 15:40:09 +01:00
parent e1c9346baa
commit a946cb82da
3 changed files with 5 additions and 4 deletions

View File

@ -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:

View File

@ -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)]]

View File

@ -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):