python-008基本数据类型常用功能
Posted 超哥最帅
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python-008基本数据类型常用功能相关的知识,希望对你有一定的参考价值。
基本数据类型常用功能: 数字 int 字符串 str 布尔型 bool 列表 list 元祖 tuple 字典 dict # 查看对象的类,或对象所具备的功能 temp = "temp" chengbao = type(temp) print(chengbao) 1.ctrl + 类型 :查看方法,引用方法。 2.temp = ‘alex‘ print(dir(temp)) 3.help(type(temp)) 方法如下: [‘__add__‘, ‘__class__‘, ‘__contains__‘, ‘__delattr__‘, ‘__doc__‘, ‘__eq__‘, ‘__format__‘, ‘__ge__‘, ‘__getattribute__‘, ‘__getitem__‘, ‘__getnewargs__‘, ‘__getslice__‘, ‘__gt__‘, ‘__hash__‘, ‘__init__‘, ‘__le__‘, ‘__len__‘, ‘__lt__‘, ‘__mod__‘, ‘__mul__‘, ‘__ne__‘, ‘__new__‘, ‘__reduce__‘, ‘__reduce_ex__‘, ‘__repr__‘, ‘__rmod__‘, ‘__rmul__‘, ‘__setattr__‘, ‘__sizeof__‘, ‘__str__‘, ‘__subclasshook__‘, ‘_formatter_field_name_split‘, ‘_formatter_parser‘, ‘capitalize‘, ‘center‘, ‘count‘, ‘decode‘, ‘encode‘, ‘endswith‘, ‘expandtabs‘, ‘find‘, ‘format‘, ‘index‘, ‘isalnum‘, ‘isalpha‘, ‘isdigit‘, ‘islower‘, ‘isspace‘, ‘istitle‘, ‘isupper‘, ‘join‘, ‘ljust‘, ‘lower‘, ‘lstrip‘, ‘partition‘, ‘replace‘, ‘rfind‘, ‘rindex‘, ‘rjust‘, ‘rpartition‘, ‘rsplit‘, ‘rstrip‘, ‘split‘, ‘splitlines‘, ‘startswith‘, ‘strip‘, ‘swapcase‘, ‘title‘, ‘translate‘, ‘upper‘, ‘zfill‘]
以上是关于python-008基本数据类型常用功能的主要内容,如果未能解决你的问题,请参考以下文章