作业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("女孩年龄过大不招收")