Python学习笔记之【内建函数】2019-08-08

2019-08-08  本文已影响0人  平知
函数名 函数名
abs() delattr() hash() memoryview() set()
all() dict() help() min() setattr()
any() dir() hex() next() slice()
ascii() divmod() id() object() sorted()
bin() enumerate() input() oct() staticmethod()
bool() eval() int() open() str()
breakpoint() exec() isinstance() ord() sum()
bytearray() filter() issubclass() pow() super()
bytes() float() iter() print() tuple()
callable() format() len() property() type()
chr() frozenset() list() range() vars()
classmethod() getattr() locals() repr() zip()
compile() globals() map() reversed() __import__()
complex() hasattr() max() round()

函数(测试环境:ipython)

hasattr(myObj, '__iter__')
#或者
In [19]: a=[]
    ...: a.__iter__
    ...: a.__iter__()
    ...: 
Out[19]: <list_iterator at 0x7fac201854e0>

In [8]: ascii([1,2,3,4])
Out[8]: '[1, 2, 3, 4]'

In [9]: a=ascii([1,2,3,4])

In [10]: type(a)
Out[10]: str
In [18]: bin(123)
Out[18]: '0b1111011'
上一篇 下一篇

猜你喜欢

热点阅读