摘要:
写代码,有如下变量name=' aleX',please inplement each function as required name =' aleX' print(name.strip())## remove the space on both side, and print the resu 阅读全文
posted @ 2025-12-17 14:39
LM0T
阅读(7)
评论(0)
推荐(0)
摘要:
输入姑娘的年龄后,进行以下判断: 如果姑娘小于18岁,打印“未成年” 如果姑娘大于18岁小于25岁,打印“表白” 如果姑娘大于25岁小于45岁,打印“阿姨好” 如果姑娘大于45岁,打印“奶奶好” # age=input('请输入年龄') # age=int(age) # if age<18: # p 阅读全文
posted @ 2025-12-06 11:07
LM0T
阅读(5)
评论(0)
推荐(0)
摘要:
使用格式化的三种方式输出自己的name、height、weight 第一种占用符方式 name=input('name>>>') height=input('height>>>') weight=input('weight>>>') print('My name is %s,My height is 阅读全文
posted @ 2025-12-03 10:51
LM0T
阅读(6)
评论(0)
推荐(0)
摘要:
简述python的垃圾回收机制 当一个变量值的引用计数为0时,python会将其在内存占用回收 对于以下代码 x=10 y=10 z=10 del y 10的引用计数为多少 由于10位于python的最小整数池中所以10的引用计数为2+1=3 x=257 y=x del x z=257 x对应的变量 阅读全文
posted @ 2025-12-01 21:41
LM0T
阅读(10)
评论(0)
推荐(0)
浙公网安备 33010602011771号