新年祭
2019-02-04 本文已影响17人
RabbitMask
import datetime
def days(str1,str2):
date1=datetime.datetime.strptime(str1[0:10],"%Y-%m-%d")
date2=datetime.datetime.strptime(str2[0:10],"%Y-%m-%d")
num=(date1-date2).days
return num
def main():
print('距离ParrotSec公众号创建:{}天'.format(days('2019-02-04','2018-08-29')))
if __name__ == '__main__':
main()
#输出:
距离ParrotSec公众号创建:159天
import random
while True:
money = round(random.uniform(0.1,5.4),2)
print ("成功给微信用户 情书吖 抢到"+str(money)+"元红包,红包已存入钱包,感谢使用……")