Python Forum
How to calculate tax with a variable input and if else
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to calculate tax with a variable input and if else
#7
income = float(input("Enter the annual income: "))
if (10000<= income <= 85528):
    Tax = ((income*18)/100)-556.2
elif income >= 85528: 
    Tax =((income- 85528)*32)/100+14839.2
elif (-100 <= income<=1000): #based on the test data i just entered these no.
    Tax = 0.0
Tax = round(Tax, 0)
print("The tax is:", Tax, "thalers")
buran write Feb-09-2021, 11:25 AM:
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.
Reply


Messages In This Thread
RE: How to calculate tax with a variable input and if else - by shalinisamipillai - Feb-09-2021, 11:21 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [split] How to calculate tax with a variable input and if else rokemas 1 2,112 Dec-28-2020, 06:53 AM
Last Post: buran
  New to Python - tiny coding assistance on user input function and assign to variable Mountain_Duck 1 2,497 Mar-23-2019, 06:54 PM
Last Post: Yoriz
  How to make a dynamic variable based on input loltylerdowney 3 3,775 Nov-30-2017, 09:49 PM
Last Post: loltylerdowney

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020