chandeg minus func
This commit is contained in:
parent
b78efac316
commit
895695f5a8
9
calc.py
9
calc.py
@ -1,7 +1,7 @@
|
||||
def main():
|
||||
print("Welcome to the Calculator")
|
||||
command = input("Select command: [ + ] [ - ] [ * ] [ / ] \nType exit if u want exit \n")
|
||||
match command:
|
||||
match command: #выбор команд
|
||||
case "+":
|
||||
summ()
|
||||
case "*":
|
||||
@ -18,7 +18,7 @@ def summ():
|
||||
total = 0
|
||||
while True:
|
||||
num_input = input()
|
||||
if num_input == " ":
|
||||
if num_input == " " or num_input == "":
|
||||
print (f"Total summ = {total}")
|
||||
main()
|
||||
try:
|
||||
@ -43,7 +43,7 @@ def minus():
|
||||
print("Error, enter correct number")
|
||||
def multiplication():
|
||||
print("Enter number to multiplication, enter space to calculate")
|
||||
total = 0
|
||||
total = 1
|
||||
while True:
|
||||
num_input = input()
|
||||
if num_input == " ":
|
||||
@ -55,5 +55,6 @@ def multiplication():
|
||||
print(f"Total multiplication = {total}")
|
||||
except ValueError:
|
||||
print("Error, enter correct number")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
main() #запуск функции main, основа программы
|
||||
Loading…
Reference in New Issue
Block a user