Python3.6 full Stack Development example [023]

Source: Internet
Author: User

23. Tax department collects income tax. The provisions are as follows:
(1) The income is below 2000. Exempt from.
(2) income in 2000-4000, more than 2000 parts of the levy of 3% tax.
(3) income in 4000-6000, more than 4,000 parts of the levy of 4% tax.
(4) income in 6000-10000, more than 6,000 parts of the levy of 8% tax.
(5) More than 10000 of the income, more than the partial levy of 20% tax.
Note: If a person's income is 8000, then he will pay 2000 to 4000 tax plus 4000 to 6000 tax plus 6000 to 8000 tax.
Revenue = 8000-(4000-2000) *3%-(6000-4000) *4%-(8000-6000) *8%
Let the user enter its salary and calculate how much the end-user gets the hand.

L1 = [10000,6000,4000,2000= [0.2,0.08,0.04,0.03=int (input (' Please enter your income: ' ). Strip ()) for in L1:    if salary > i:        #  Print (L1.index (i))        Shuiwu + = (salary-i) *l2[l1.index (i)        ]= I  Print(SALARY-SHUIWU)
Salay = [10000,6000,4000,2000, 0]tax= [0.2,0.08,0.05,0.03]t= {10000:0.2,6000:0.08,4000:0.05,2000:0.03}content= Int (Input ('Please enter your salary.')) C=Contentsum_tax=0 forIinchT.items ():ifContent >i[0]: Sum_tax+ = (content-i[0]) *i[1] Content=I[0]Print('Pre-tax salary: {}'. Format (c))Print('Personal income tax: {}'. Format (sum_tax))Print('Get paid: {}'. Format (C-sum_tax))

Python3.6 full Stack Development example [023]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.