if 属于条件语句,判断条件为真是,执行对应的代码;还有一个else语句,和if可以一起使用,对条件不为真的情况进行处理,举例如下:a ,b= input() # 输入两个整数,用逗号隔开if a > b:print 'a is bigger than b'else:print 'b is bigger than a'
sex = str(raw_input("are you girl:f or m "))if sex == "m":print "sorry, you can not join our team."else:print "second question:"year = float(raw_input("how old are you"))if 10 <=year<=12:print "you can join our football team."你可以试试这个代码,不过是2.7.5版本Python