diff --git a/harj_10/__pycache__/utils.cpython-38.pyc b/harj_10/__pycache__/utils.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..29700648978416476d2c5afc50321b299596ca8b Binary files /dev/null and b/harj_10/__pycache__/utils.cpython-38.pyc differ diff --git a/harj_10/tester.py b/harj_10/tester.py new file mode 100644 index 0000000000000000000000000000000000000000..856dec207b8360603e348d8c2a7a12eccd8d45c5 --- /dev/null +++ b/harj_10/tester.py @@ -0,0 +1,12 @@ +from utils import show_info +from utils import average +from utils import subtract +from utils import calc_consumption + +show_info() + +print(average(10,20,30)) + +print(subtract(100,10)) + +calc_consumption() \ No newline at end of file diff --git a/harj_10/utils.py b/harj_10/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..33bbc6dd5be9632e353dfa8697ec3825766d69fb --- /dev/null +++ b/harj_10/utils.py @@ -0,0 +1,15 @@ +def show_info(): + print("I´m utils.info") + +def subtract(a,b): + return a-b + +def average(a,b,c): + return (a+b+c)/3 + +def calc_consumption(): + kulutus= int(input("Anna kulutus: ")) + hinta= int(input("Anna bensan hinta: ")) + matka = int(input("Anna matka: ")) + x= kulutus*hinta/matka*100 + print(x) \ No newline at end of file