(之前写的第一天Actually是第二天因为第一天是简单介绍Python这个百度百科都有我就不发了,从今天开始算是第三天不是,没更第二天QAQ)Python课程第三天_上午_课程笔记(数据结构)

Day_02_Data_Structure_Note


'''
Python的数据类型

int,float,complex
str:字符串
bool:布尔类型,只有两个值:True or False
None:空值类型,只有一个值:None

List:列表/数组
tuple:元组/不可变数组
dict:字典
set:集合(了解,不需要记)
bytes:字节/二进制
'''

# int
# 复数a+bi(数学的计算机用不到)
a = 100
print(a, type(a))

# float
b = 10.3
print(b, type(b))

# 小数精度
# c = 33.8
# print(1.8 / 1.8)  # 1
# print(((c - 32)) / 1.8)  # 0.999...
# print(round(s))

# str
c = 'JohnLuo'
print(c, type(c))

# bool
d = True
print(d, type(d))
print(int(True), int(False))

# None类型
e = None
print(e, type(e))

# List
f = [1,2,3]
print(f, type(f))

# tuple

g = (1,2,3)
print(g, type(g))

# dict
h = {"name": "Johnluo","age": 19}
print(h, type(h))

# set(了解)
i = {1,2,3}
print(i, type(i))

# bytes
j = b'hello'
print(j, type(j))




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值