码迷,mamicode.com
首页 > 编程语言 > 详细

Python开发 基礎知識 3.類別&方法 (bool & str) (未完待續)

时间:2018-10-31 13:46:57      阅读:151      评论:0      收藏:0      [点我收藏+]

标签:class   使用   ict   false   string   pytho   lse   ==   tuple   

類別

可使用type()查看

內建 [ 布爾:bool (Boolen)  字串:str (String)  數字:int (Integer)  小數:float 列表:list  元祖:tuple  字典:dict ]

亦可用class宣告新類別

 

布爾值  (用於比較、邏輯、成員判定之運算)

以 1=True,  0=False 紀錄於記憶體中

資料判定上,有東西 or 判定為真=True,沒東西( "", [ ], ( ), { }, 0 )or判定為假=False

有邏輯運算 ( and   or   not)

有關係符 ( < (小於)   <= (小於等於)   == (等於)  >= (大於等於)  > (大於)  != or <> (不等於) )

 

字串 (用於算術、賦值運算)

 

Python开发 基礎知識 3.類別&方法 (bool & str) (未完待續)

标签:class   使用   ict   false   string   pytho   lse   ==   tuple   

原文地址:https://www.cnblogs.com/pyleu1028/p/9882359.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!