Python3.6全棧開發執行個體[023]

來源:互聯網
上載者:User

標籤:mat   items   item   +=   pre   部門   bsp   它的   col   

23.稅務部門徵收所得稅. 規定如下:
(1)收入在2000以下的. 免徵.
(2)收入在2000-4000的, 超過2000部分要徵收3%的稅.
(3)收入在4000-6000的, 超過4000部分要徵收4%的稅.
(4)收入在6000-10000的, 超過6000部分要徵收8%的稅.
(5)收入在10000以上的, 超過部分徵收20%的稅.
注:如果一個人的收入是8000, 那麼他要交2000到4000的稅加上4000到6000的稅加上6000到8000的稅.
收入 = 8000-(4000-2000)*3%-(6000-4000)*4%-(8000-6000)*8%
讓使用者輸入它的工資, 計算終端使用者拿到手是多少錢.

l1 = [10000,6000,4000,2000,0]l2 = [0.2,0.08,0.04,0.03]shuiwu = 0salary = int(input(‘請輸入你的收入:‘).strip())for i in l1:    if salary > i:        # print(l1.index(i))        shuiwu += (salary-i)*l2[l1.index(i)]        salary = iprint(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(‘請輸入你的工資‘))c = contentsum_tax = 0for i in t.items():    if content > i[0]:        sum_tax += (content - i[0])*i[1]        content = i[0]print(‘稅 前 工資:{}‘.format(c))print(‘個人所得稅:{}‘.format(sum_tax))print(‘到 手 工資:{}‘.format(c-sum_tax))

 

Python3.6全棧開發執行個體[023]

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.