摘要:
1、算数运算符print(10 + 3.1)print(10 + 3)print(10 / 3) # 结果带小数print(10 // 3) # 只保留整数部分print(10 % 3) # 取模、取余数print(10 ** 3) # 取模、取余数2、比较运算符: >、>=、<、<=、==、!=p 阅读全文
posted @ 2020-03-05 19:14
Dimple_Y
阅读(177)
评论(0)
推荐(0)
摘要:
1、接收用户的输入在Python3:input会将用户输入的所有内容都存成字符串类型username = input("请输入您的账号:") # "egon"print(username, type(username))age = input("请输入的你的年龄: ") # age="18"prin 阅读全文
posted @ 2020-03-05 19:11
Dimple_Y
阅读(179)
评论(0)
推荐(0)
摘要:
垃圾回收机制1、引用计数x = 10 # 直接引用print(id(x))y = xz = xl = ['a', 'b', x] # 间接引用print(id(l[2])) #d = {'mmm': x} # 间接引用print(id(d['mmm']))x=10l=['a','b',x] # l= 阅读全文
posted @ 2020-03-05 19:06
Dimple_Y
阅读(153)
评论(0)
推荐(0)
摘要:
# 作业: 0、分别画出下面两个列表在内存中是如何存放的 # l1=[11,22,[333,444]] # l2=[11,22,[33,{'name':'egon','age':18}]] # 1、 用户输入姓名、年龄、工作、爱好 ,然后打印成以下格式# info of Egon # Name : 阅读全文
posted @ 2020-03-05 18:54
Dimple_Y
阅读(173)
评论(0)
推荐(0)

浙公网安备 33010602011771号