python的类及对象所在的类

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python的类及对象所在的类相关的知识,希望对你有一定的参考价值。

python 的类如下:

  字符串 :str

  数   值 :int

  布尔值:bool

  列   表:lis

  元   组:tuple

  字   典:dict

所有对象所具备的功能都存放在上面对应的类里面。

             i = "test"

     print (type(i))
<type ‘str‘> str 是i对应的类

i2 = 234
     print (type(i3))
     <type ‘int‘> ‘int’ 是i2对应的类

可以通过下面的命令查看类对应的各种功能:

             

     dir([object]) -> list of strings  快速查找类都有哪些功能


            help(type(
object)) 查看详细功能

           

            直接点击鼠标 ctrl+鼠标左键

 





以上是关于python的类及对象所在的类的主要内容,如果未能解决你的问题,请参考以下文章