zoukankan      html  css  js  c++  java
  • 基本数据类型(一)

     

    一、数字

    整形  int:

    #在32位机器上,整数的位数为32位,取值范围为-2**31~2**31-1,即-2147483648~2147483647
    #在64位系统上,整数的位数为64位,取值范围为-2**63~2**63-1,即-9223372036854775808~9223372036854775807

    可将字符串转为数字:


    二、布尔值

    True、False

    0    、 1

     

    三、字符串(比较重要的:join/find/split/strip/upper/lower/replace等)

    字符串常用功能:

    • 移除空白(strip)
    • 分割(split)
    • 索引

    • 切片

    •  长度

     1、 capitalize

     

     

     2、casefold

     

    3、center

     4、count

     

     5、startswith

           endswith

     

    6、find

     7、format

     

    8、isalnum

    9、expandtabs

    10、isalpha

    11、isdecimal

     

    12、isprintable

     13、isspace

     

    14、istitle     title

    15、join(重要)

     16、ljust     rjust

     

     17、islower       lower

     

     18、isupper   upper

     

    19、lstrip    rstrip    strip

    20、maketrans

    21、partition       rpartition

    22、split        rsplit

    23、splitlines

    24、startswith    endswith

     

    25、swapcase

     

    26、replace

  • 相关阅读:
    Linux/UNIX编程:实现简单 tee 命令
    Java原子变量类需要注意的问题
    一种很有意思的数据结构:Bitmap
    Java实现简单井字棋
    分治算法学习
    使用栈实现表达式求值
    Web安全学习笔记——SQL注入
    【old】Python学习笔记
    函数1
    pycharm(Tip of Day)
  • 原文地址:https://www.cnblogs.com/chengweizhong/p/8413235.html
Copyright © 2011-2022 走看看