python基本数据类型

一、

数字 int

字符串 str

布尔值 bool

字典 dict

列表 list

元组 temp

 所有数据类型,都在内部存在相对应的类

二、

运算符  

num +=1 自加1

num -=1

num *=1

num /=1

三、

查看对象的类,或对象所具备的功能

1、type

temp="alex"

t=type(temp)

print(t)

#str,ctr+鼠标左键,找到str类,内部所有的方法,可以通过project栏右上角的定位找到类

2.dir

temp=‘alex’

b=dir(temp)

3、help,type

help(type(temp))

先获取到当前数据的类,再查看help调出所有方法

常用于看别人的代码

ctrl键+鼠标左键,可以找到当前数据类型内部的所有方法。

原文地址:https://www.cnblogs.com/aqiuarcadia/p/7290399.html