码迷,mamicode.com
首页 > 其他好文 > 详细

py练习x11.1

时间:2015-07-16 19:28:53      阅读:145      评论:0      收藏:0      [点我收藏+]

标签:

# -*- coding: utf-8 -*-

"""

num1=100000*0.01

num2=200000*0.75+num1

num3=400000*0.05+num2

num4=400000*0.03+num3

num5=600000*0.015+num4

num6=1000000*0.01+num5

def num():

    if num1>=i:

        numx=i*0.01

    elif 100000<=i<=200000:

        numx=num1+(i-100000)*0.75

    elif 200000<=i<=400000:

         numx=num2+(i-200000)*0.05

    elif 400000<=i<=600000:

        numx=num3+(i-400000)*0.03

    elif 600000<=i<=1000000:

         numx=num4+(i-600000)*0.015

    elif i>=1000000:

         numx=num5+(i-1000000)*0.01

    print ‘liruwei:‘,numx

if __name__==‘__main__‘:

    i=input(‘enter:‘)

    num()

"""

year=int(raw_input("input year:"))

month=int(raw_input("input month:"))

day=int(raw_input("input day:"))

months = (0,31,59,90,120,151,181,212,243,273,304,334)

if (1<=month<=12):

    days=months[month-1]+day

else:

    print "month errors!"

leap=0

if ((year%4==0) and (year%100!=0)) or (year%400==0):

    leap=1

if (leap==1) and (month>=2):

    days+=1

print ‘it is the %dth day.‘% days

 

py练习x11.1

标签:

原文地址:http://www.cnblogs.com/mhxy13867806343/p/4156444.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!