首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > perl python >

Python 入门教程 五 - Conditionals & Control Flow

2013-09-18 
Python 入门教程 5 ---- Conditionals & Control Flow 第一节1 介绍Python利用有6种比较的方式 , ! ,

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



热点排行