2018-05-12 11:37:19 +02:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
|
|
|
|
def suma(a, b):
|
|
|
|
"""
|
|
|
|
Napisz funkcję, która zwraca sumę elementów.
|
|
|
|
"""
|
2018-06-01 08:04:07 +02:00
|
|
|
suma= a+b
|
|
|
|
|
|
|
|
return suma
|
2018-05-12 11:37:19 +02:00
|
|
|
|
|
|
|
def tests(f):
|
|
|
|
inputs = [(2, 3), (0, 0), (1, 1)]
|
|
|
|
outputs = [5, 0, 2]
|
|
|
|
|
|
|
|
for input, output in zip(inputs, outputs):
|
|
|
|
if f(*input) != output:
|
|
|
|
return "ERROR: {}!={}".format(f(*input), output)
|
|
|
|
break
|
|
|
|
return "TESTS PASSED"
|
|
|
|
|
|
|
|
print(tests(suma))
|