Pythom :2017/05/13

字符串str = "c:\now",str= c:\now;

but print (str)

Python学习历程(方法名及使用)

判定为字符串。



把对象属于对象的函数称之为方法:

(python的数组、列表添加方法名)
pg:
member.pop('利用栈的原理,提取最后一个元素')
member.append('给数组添加一个元素')
member.insert(n,'对指定位置n添加元素')

member.extend(['扩展列表','和下一个列表'])



元组: 关键字:tuple
type:用于显示数据类型,例如 type(XX)
 元组:tuple1 = (1,2,3) or tuple2  = 1,2,3,元组类型在于逗号。
 添加: tuple1 = (a, b, c,d,e)
 tuple1 = tuple1[:2]+("C1")+tuple1[2:]
 取其某一元素 tuple1[2],前两个 tuple1[:2] 

相关文章:

  • 2021-10-07
  • 2021-12-10
  • 2021-08-08
  • 2021-12-01
  • 2021-12-22
  • 2021-06-17
  • 2021-10-19
  • 2022-01-17
猜你喜欢
  • 2021-11-12
  • 2022-01-05
  • 2022-12-23
  • 2022-12-23
  • 2021-05-21
  • 2022-12-23
相关资源
相似解决方案