博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
FLOW CONTROL
阅读量:4316 次
发布时间:2019-06-06

本文共 1500 字,大约阅读时间需要 5 分钟。

A\The differences between == and = operators:

1 the == operator(equal to) asks whether two values are the same as each other;

2 the = operator(assignment)puts the value on the right into the variable on the left. 

 

B\ Comparison Operator :  ==   !=  >  <  >=  <=

     Boolean Operator      : and  or  not

     Boolean Value: Ture False

 

C\Boolean operators have an order of operations:

   1 Math and comparison operators first;

   2 not first,then the and,or last; 

    e.g: not not True or False and not True     the result is True

 

D\Lines of python code can be grouped together in blocks.You can tell when a block begins and ends from the indentation of the lines of code:

   1 Blocks begin when the indentation increases;

   2 Blocks can contain other blocks;

   3 Blocks end when the indentaiton decreases to zero,or to a containing block's indentation;

 

 E\There are some values in other data types (not undefined variable) that conditions will consider equivalent to True and False.When used in conditons,0,0.0 and ' '(the empty string)are considerd False,while all other values are considered True.

  e.g   

1 name=''2 while not name:3     print('enter your name:')4     name=input()5 print('how many guests do you have?')6 numofGuest=int(input())7 if numofGuest:8     print('make sure have enough room.')9 print('Done!')

 

 

F\ if\while contains:  1\keyword (if,while)  2\condition(Boolean Expression) 3\colon  4\clause

           for contains:   1\for keyword 2\variable 3\in keyword 4\range()method 5\colon 6\clause

 

转载于:https://www.cnblogs.com/auLeon/p/7306358.html

你可能感兴趣的文章
c语言第五次作业
查看>>
多线程执行显示进度条的实例
查看>>
【总结】 NOIp2018考时经历记
查看>>
DIY远程控制开关(tiny6410+LED+yeelink+curl)
查看>>
SGU[130] CIrcle
查看>>
深入V8引擎-Time核心方法之win篇(1)
查看>>
指令操作码与地址码
查看>>
Bogo排序
查看>>
字节对齐
查看>>
基于JavaConfig配置的拦截器使用
查看>>
HTML 个人资料框
查看>>
Selenium+IDEA+Maven+TestNG环境搭建
查看>>
Tyvj1057
查看>>
bzoj2463谁能赢呢?
查看>>
Java复习-arraylist和vector
查看>>
【单镜头反光相机】简介
查看>>
HTTP 之 Content-Type
查看>>
R聚类分析
查看>>
Cognos TM1_10.1.1服务端配置
查看>>
[linux 整理] linux启动过程3
查看>>