forked from tdwojak/Python2018
22 lines
433 B
Python
22 lines
433 B
Python
|
#!/usr/bin/env python3
|
||
|
# -*- coding: utf-8 -*-
|
||
|
|
||
|
|
||
|
def suma(a, b):
|
||
|
"""
|
||
|
Napisz funkcję, która zwraca sumę elementów.
|
||
|
"""
|
||
|
return a + b
|
||
|
|
||
|
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))
|