Python有三种数据类型:
  1. number,又有四种类型
    1. integer
    2. long integer
    3. floating point
    4. complex number
  2. string
    1. 单引号'
    2. 双引号"
    3. 三引号'''或者""":三引号里面可以用单引号和双引号
  3. class
Note:
在string里面,转义字符的应用和C几乎一致。
Python增加了对unicode的支持,如果要用unicode,办法很简单,在string前面加一个前缀u或者U,比如u"This is a Unicode string."
string是不可以改变的,类似与C里面的const
string是可以自动连接在一起的,比如'what\'s' 'you name'会被转换成'what\'s you name'
在Python里面,变量不需要像C那样先声明,再使用,而是可以直接使用
 
 
 




相关文章:

  • 2021-08-07
  • 2021-10-07
  • 2022-12-23
  • 2022-12-23
  • 2021-09-29
  • 2022-12-23
  • 2021-07-08
  • 2021-10-31
猜你喜欢
  • 2021-06-25
  • 2021-06-10
  • 2021-10-08
  • 2021-09-15
  • 2022-02-03
  • 2021-08-29
  • 2021-05-29
相关资源
相似解决方案