Simple calculator not adding | Cant figure out why
Question:
first = input("Enter First Number: ")
second = input("Enter Second Number: ")
value = first + second
print(first + "+" + second + "=" + value)
I want it to add both numbers and give me the result for example 1+2=3, but it keeps doing 1+2=12 instead. does anyone know why this is happening?
Answers:
first = input("Enter First Number: ")
second = input("Enter Second Number: ")
value = float(first) + float(second)
print(str(first) + "+" + str(second) + "=" + str(value))
first = input("Enter First Number: ")
second = input("Enter Second Number: ")
value = first + second
print(first + "+" + second + "=" + value)
I want it to add both numbers and give me the result for example 1+2=3, but it keeps doing 1+2=12 instead. does anyone know why this is happening?
first = input("Enter First Number: ")
second = input("Enter Second Number: ")
value = float(first) + float(second)
print(str(first) + "+" + str(second) + "=" + str(value))