读书人

Python 入门教程 五 - Conditionals amp;

发布时间: 2013-09-18 14:17:40 作者: rapoo

Python 入门教程 5 ---- Conditionals & Control Flow


第一节

1 介绍Python利用有6种比较的方式 == , != , > , >= , < , <=

2 比较后的结果是True或者是False

3 练习

1 把bool_one的值设置为 17 < 118%100

2 把bool_two的值设置为 100 == 33*3 + 1

3 把bool_two的值设置为 19 <= 2**4

4 把bool_four的值设置为 -22 >= -18

5 把bool_five的值设置为 99 != 98+1

def the_flying_circus():    # Start coding here!    if 1 < 2 and not False:        return True    elif 1 == 1 or 1 != 2 or 1 < 2 or 1 <= 2 or 1 > 2 or 1 >= 2:        return True    else:        return False



读书人网 >perl python

热点推荐