python查看对象的类,或对象所具备的功能

1.type

  temp = "alex"

  t = type(temp)

  print(t)

  #str,ctrl+鼠标左键,找到str类,查看内部所有的方法

2.dir

  temp = "alex"

  b = dir(temp)

3.help,type

  help(type(temp))

4.直接点击

  temp = "alex"

  temp.upper()

鼠标放在upper()上CTRL + 左键,自动定位到upper功能处

  

猜你喜欢

转载自www.cnblogs.com/xiaomakeji/p/8933868.html