I am basically trying to make a database in Python, in which each ''data'' would consist of a string and a number equivalent (or something close to it), and I am looking for a way which would allow an end-user to enter an input corresponding to one of the strings in the database and refer it to its corresponding float value, to then perform simple arithmetic operations. This is what I made and it does nothing at all
c = float(2.66)
d = float(6.68)
test = input('Enter the letter')
test2 = input('Enter the second letter')
if test == c and test2 == d:
print(float(c)+float(d))
EDIT : I just revisited this page and found the solution to my problem all by myself, all that was missing was the quotation marks in the code and the variable definition together. the correct way to do it is the following:
c = float(2.66)
d = float(6.68)
test = str(input('Enter the letter'))
test2 = str(input('Enter the second letter'))
if test == str('c') and test2 == str('d') :
print(float(c)+float(d))
if this need to be deleted I will do it