Python2017/labs02/test_task.py
2017-12-16 09:11:17 +01:00

34 lines
640 B
Python
Executable File

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
def suma(a, b):
<<<<<<< HEAD
return a+b
=======
"""
Napisz funkcję, która zwraca sumę elementów.
"""
return a + b
>>>>>>> 8c76a052001eb7efe6cb0610a238cad5181c7325
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"
<<<<<<< HEAD
if __name__ == "__main__":
print(tests(suma))
=======
print(tests(suma))
>>>>>>> 8c76a052001eb7efe6cb0610a238cad5181c7325