Jul-18-2017, 08:18 PM
So i started making a really simple calculator. im just a begginer it was a good training for me.
and the rest of the commands simply show me this error
Traceback (most recent call last):
File "C:/Users/Yonatan/PycharmProjects/Python Programs/Calculator.py", line 8, in <module>
print(int(num1 * num2))
TypeError: can't multiply sequence by non-int of type 'str'
Thank you very much for helping!
print("Hello there, enter your first number") num1 = input() print("Enter your second number") num2 = input() print("What Do you want to do with these numbers? Please enter Divide/Add/Remove/Duplicate") thing = input() if thing == "Duplicate": print(int(num1 * num2)) if thing == "Remove": print(int(num1 - num2)) if thing == "Divide": print(int(num1 / num2)) if thing == "Add": print(int(num1 + num2))When i use the add command i am getting the two numbers combined. lets say i did 4 and 4 so im getting 44
and the rest of the commands simply show me this error
Traceback (most recent call last):
File "C:/Users/Yonatan/PycharmProjects/Python Programs/Calculator.py", line 8, in <module>
print(int(num1 * num2))
TypeError: can't multiply sequence by non-int of type 'str'
Thank you very much for helping!
