以3.5.2版为例,内置函数共有72个:
['abs', 'all', 'any', 'ascii', 'bin', 'bool', 'bytearray', 'bytes', 'callable', 'chr', 'classmethod', 'compile', 'complex', 'copyright', 'credits', 'delattr', 'dict', 'dir', 'divmod', 'enumerate', 'eval', 'exec', 'exit', 'filter', 'float', 'format', 'frozenset', 'getattr', 'globals', 'hasattr', 'hash', 'help', 'hex', 'id', 'input', 'int', 'isinstance', 'issubclass', 'iter', 'len', 'license', 'list', 'locals', 'map', 'max', 'memoryview', 'min', 'next', 'object', 'oct', 'open', 'ord', 'pow', 'print', 'property', 'quit', 'range', 'repr', 'reversed', 'round', 'set', 'setattr', 'slice', 'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple', 'type', 'vars', 'zip']
可以用help查看说明,如:help(print)
你所说的3个,
int简单的说是是转换成一个整数(当然学到面向对象,学到类就会有新的认识)
- >>> int(10)
- 10
- >>> int(10.5)
- 10
- >>> int('123')
- 123
- >>> int('1000', base = 2)
- 8
- >>> int()
- 0
复制代码
temp不是内置函数
print是输出函数
- >>> print('hello')
- hello
- >>> print(123)
- 123
- >>> print(3 + 2)
- 5
- >>> print('a', 'b', 'c')
- a b c
复制代码 |