【类型功能剖析】python类型功能剖析

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

1丶type

  temp="hellw"   #temp是字符串对象

  a=type(temp)

  print(a) #输出的结果为str类型

  #在pycharm中,ctrl+鼠标左键,找到str类,内部所有的方法

2丶dir

  temp="hellw"

  b=dir(temp);

  print(b)#打印出temp所在的对象中所具备的功能方法的名称

3丶help,type

  temp="hellw"

  help(type(temp))   #打印出temp所在的对象中所具备的功能方法的详细用法

  

posted @ 2017-05-31 15:18  丰study  阅读(127)  评论(0)    收藏  举报