Python——数据类型
Number型——整型
age=18
age1=0b10010
print(age)
print(age1)
18
18
age=18
age1=0O22
print(age)
print(age1)
18
18
age=18
print(age)
18
age=18
age1=0x12
print(age)
print(age1)
18
18
Number型——浮点型
float1=3.1415926
print(float1)
float2=314e-2
print(float2)
3.1415926
3.14
Number型——复数
com1=32+65j
print(com1)
com2=complex(32,65)
print(com2)
(32+65j)
(32+65j)
Number型——布尔
a,b=3,2
print(a)
print(b)
print(a==b)
a,b=4,4
print(a)
print(b)
print(a==b)
3
2
False
4
4
True
字符串str
str1='lalalalal'
print(str1)
lalalalal
列表list
list1=[1,2,3,34,5,6]
print(type(list1))
print(list1)
list2=range(1,8)
print(list2)
list3=['张全蛋','赵铁柱','王者荣耀','英雄联盟','AA',123,12]
print(list3)
[1, 2, 3, 34, 5, 6]
range(1, 8)
['张全蛋', '赵铁柱', '王者荣耀', '英雄联盟', 'AA', 123, 12]
元组tuple
tuple1=1,2,3,4
print(type(tuple1))
print(tuple1)
tuple2=(1,3,5)
print(type(tuple2))
print(tuple2)
(1, 2, 3, 4)
(1, 3, 5)
dict字典
dict1={"one":1,"two":2,"three":3}
print(type(dict1))
print(dict1)
{'one': 1, 'two': 2, 'three': 3}
集合set
set1={1,2,33,5,6}
print(type(set1))
print(set1)
{1, 2, 33, 5, 6}