I am a novice to the decimal module and I am not sure if the decimal module can read and process unknown values. What can I change for the code to make it work?
I researched on it, however, I cannot find an ideal answer
from decimal import Decimal
def Addition(x,y):
sum=Decimal('x')+Decimal('y')
print("The sum of {0} and {1} is {2}".format(x, y,sum))
x=float(input("Enter your first number: "))
print("Your first number is="+str(x))
y=float(input("Enter your second number: "))
print("Your second number is="+str(y))
Addition(x,y)
I expected an addition of x and y, but the output is an invalid operation of
[<class 'decimal.ConversionSyntax'>]