total and utter newbie

rockbox rockboxb at webmail.co.za
Tue Nov 12 18:35:08 EST 2002


Hi.

I hope that this is the right group to post this problem in. If not then I
appologise.

I have decided to learn python (my 1st attempt at programming) but I am
having a slight problem.

value = input('Enter Value : ')
rate = input('Enter VAT Rate : ')
vat=(rate/100)*value
total=value+vat
print 'VAT is caluculated at ' + str(rate) + '%'
print 'The total (inc vat) = ' + str(total)
print "vat is " +str(vat)
print 'value = ' + str(value)

If I run the program and give it the values of say 100 and 15.0 everything
works fine and 15% is added to 100.
However if I enter the values 100 and 15 then the program returns a value
of 100 (the vat variable is set to 0).

I know that I must be missing something simple but I can not see what.
Please help.

Thanks in advance



More information about the Python-list mailing list