if int(p)%5==0 and (int(p)>0) and (int(p)<=2000) and (float(p)>=0.00) and (float(p)<=2000.00):
print str("0.2f" (k-0.50))
#i dunno why am i getting wrong answer here.
Please give a link to the complete code, or insert the complete code here with proper indentations. This one is not readable at all.
Just take a look at the conditions you are applying to the code. You don’t have to check for 2000 at all… just apply the condition for what the problem says. It says the transaction with the charges altogether should not exceed the current balance of the user. Just apply this condition and rework your code. Hope this helps.