Я новичок здесь, в этом «мире». Я попытался создать калькулятор с Python, вот код. Когда я пытаюсь запустить его, IDLE дает мне ошибки, вы можете мне помочь, пожалуйста? .: DКалькулятор, созданный с помощью Python
Заголовок 1
print("Options")
print("Type 'add' to add two numbers")
print("Type'subtract' to subtract two numbers")
print("Type'multiply' to multiply two numbers")
print("Type'divide' to divide two numbers")
print("Type'quit' to exit")
user_input = input(": ")
if user_input == "quit":
break
elif user_input == "add" :
num1 = float(input("Insert a number: "))
num2 = float(input("Insert another number: "))
result = str(num1+num2)
print("The answer is " + result)
elif user_input == "subtract" :
num1 = float(input("Insert a number: "))
num2 = float(input("Insert another number: "))
result = str(num1+num2)
print("The answer is" + result)
elif user_input == "multiply" :
num1 = float(input("Insert a number: "))
num2 = float(input("Insert another number: "))
result = str(num1+num2)
print("The answer is " + result)
elif user_input == "divide" :
num1 = float(input("Insert a number: "))
num2 = float(input("Insert another number: "))
result = str(num1+num2)
print("The answer is " + result)
else:
print("Unknown command")
пожалуйста включают ошибку в вашем вопрос – Creos