python_process(0)

KeyWord :  Pycharm2018.02   Python 3.7  

说明:

本篇并非文章,内容较多,结构未做整理,   以模块写,尽量保证每个模块内容完整性。

模块以分割线划分,尽量格式保持一致。   内容多次写入以及更新,会有局部有重复。

 

 

1------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

1.三元运算

result = value1  if 条件 else value2 

 

eg.

a = 1    b = 2     c = 3

result = a if a>b else c

print(result)

>> 3

说明:三元运算主要是简单方便,使用时注意其格式。

 

2------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 2.bytes与string 之间的转换

 bytes 与string

3 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

4------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

5------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


6------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


7------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


8------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

posted @ 2018-09-08 19:55  楚格  阅读(325)  评论(0编辑  收藏  举报