In [91]:
taxes_rate={ 'State': {
'GA' : 0.020,
'TX' : 0.030,
'LA' : 0.040,
'FL' : 0.00,
},
'Country' : {
'SPN' : 0.3,
'CUB' : 0.1,
'MX' :0.5
}}
def tax():
print "Please enter the price of the product"
x=int(raw_input())
print 'Please enter select 1 or 2 \n(1) State \n(2) Country'
y=raw_input()
if y == '1':
place='State'
else:
place='Country'
result=str(raw_input("Select Tax Rate (%s): " % ','.join(taxes_rate[place].keys())))
print "The cost %.2f product in %s is %.2f" % (x, result, ((taxes_rate[place][result] * x) + x))
tax()
In [ ]: