PYTHON PROGRAM FOR ADDING TWO NUMBERS
simple example for python language; used for adding two numbers by the user
Voters
AllAwesome497
Could also use:
a=input("Number 1:\n>") b=input("Number 2:\n>") print("Sum:", int(a)+int(b))
Traceback (most recent call last):
File "main.py", line 2, in
a=int(input("input a : "))
ValueError: invalid literal for int() with base 10: 'uwu'
yes of course bcz i dealt with integers only
thank you for attention @TaylorLiang
You could probably solve that error by using floats instead of integers.
This would read something like:
a=float(input("input a : "))
@fawaz123
can you check now ?? @EllaFan
Yeah, it works for integers & non-integer values. The only annoying would be that if the product is an integer, it appears with a ".0" tacked on to the end. @fawaz123