Python–ToDay(01)python基本数据类型 二进制—>十六进制

1.Python数据类型

    1>数字

                    1。int 整形   ,long长整型,float 浮点型 ,complex 复数

     2>布尔值    真或假  1 或0

     3> 字符串

            字符串格式化输出   %s 字符串   ; 整数%d  ;浮点数 %f

            字符串常用功能    1:移除空白 2:分割 3:长度  ; 4索引   ;5切片

      4>列表

            创建列表:

                  name_list = [‘alex’, ‘seven’]     或者

                  name_list = list([‘ales’, ‘seven’,'eric’]}

     5>元组

                 不可变列表  创建元组

                ages =(34,56,45,43,23) 或   ages = tuple((34,34,34,))

      6>字典 无序

person = {“name”:"mr.wu”,'age':10} 或 person=dict({“name":"mr.wu",'age':18}


Python入门

   1.三元运算符           result = 值1 if 条件  else 值2

   2. 二进制转16进制   每四进一    1111   -->15

                16进制  0x 前缀; BH后缀

bytess  string   转换     ,bytes    decode  转为str     str  encode  转为bytes



    吾之爱,心之念。
           携子手,到白头。

原文地址:https://www.cnblogs.com/JC-0527/p/6980185.html