作业1

 1 # -*- coding: UTF-8 -*-
 2 import easygui
 3 
 4 a=float(easygui.buttonbox("请输入性别.说明男孩选择1,女孩选择2",choices=['1','2']))
 5 if a==2:
 6     b=float(easygui.enterbox("输入年龄"))
 7     if 10<=b<=12:
 8         easygui.msgbox("恭喜注册成功")
 9     else:
10         easygui.msgbox("女孩年龄过大过小不招收")
11 else:
12     easygui.msgbox("本队不招收男孩")

 

 1 # -*- coding: UTF-8 -*-
 2 import easygui
 3 
 4 a=float(easygui.buttonbox("请输入性别.说明男孩选择1,女孩选择2",choices=['1','2']))
 5 if a==1:
 6     easygui.msgbox("本队不招收男孩")
 7 
 8 else:
 9     b=float(easygui.enterbox("输入年龄"))
10 if 10<=b<=12:
11     easygui.msgbox("恭喜注册成功")
12 
13 else:easygui.msgbox("女孩年龄过大不招收")

 

posted on 2018-01-19 16:50  新手爱好者  阅读(90)  评论(0编辑  收藏  举报

导航