码迷,mamicode.com
首页 > 编程语言 > 详细

python-008基本数据类型常用功能

时间:2020-05-14 01:24:53      阅读:66      评论:0      收藏:0      [点我收藏+]

标签:add   引用   字符   cap   help   hook   数字   decode   gets   

基本数据类型常用功能:
	数字  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基本数据类型常用功能

标签:add   引用   字符   cap   help   hook   数字   decode   gets   

原文地址:https://www.cnblogs.com/bigdata-6/p/12885695.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!