Загрузить файлы в «/»
This commit is contained in:
commit
97facb2c78
22
kal.py
Normal file
22
kal.py
Normal file
@ -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")
|
||||||
Loading…
Reference in New Issue
Block a user