diff --git a/kal.py b/kal.py new file mode 100644 index 0000000..8c40424 --- /dev/null +++ b/kal.py @@ -0,0 +1,22 @@ +def summa(datas_nums): + a=0 + for i in datas_nums: + a+=int(i) + return a +def multiply(datas_nums): + a=1 + for i in datas_nums: + a=a*int(i) + return a + +datas=str(input("write numbers: ")) +datas_splitted=datas.split() + +choice=str(input("+ or x")) + +if choice =="+": + print(summa(datas_splitted)) +elif choice =="x": + print(multiply(datas_splitted)) +else: + print("Error try again") \ No newline at end of file