您好,欢迎来到叨叨游戏网。
搜索
您的当前位置:首页Python星座查询

Python星座查询

来源:叨叨游戏网

代码

代码如下:

while True:
    d = input('请输入出生日期:')
    if d.isdigit():
        print('出生日期:', d)
        break
    else:
        print('输入的日期有误')
d = int(d)
for i in info:
    t = info[i].split('-')
    t1 = int(t[0])
    t2 = int(t[1])
    if d >= t1 and d <= t2:
        print('你的星座是:', i)
        break
    if d >= 1222 and d <= 1231:
        print('你的星座是:摩羯座')
        break
    #因为不支持0开头的数字所以使用了这种方法
    if d >=int('0101') and d <=int('0119'):
        print('你的星座是:摩羯座')
        break

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- gamedaodao.net 版权所有 湘ICP备2024080961号-6

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务