08 2024 档案

摘要:1.九九乘法表 print('\n'.join([' '.join(["%2s ×%2s = %2s"%(j,i,i*j) for j in range(1,i+1)]) for i in range(1,10)])) #等价于以下语句: for i in range(1,10): print("" 阅读全文
posted @ 2024-08-05 09:59 近我者赤 阅读(10) 评论(0) 推荐(0) 编辑
摘要:整个集合大概是按照难易程度排序,简单常见的在前面,比较少见的在最后。 1.1 拆项 >>> a, b, c = 1, 2, 3 >>> a, b, c (1, 2, 3) >>> a, b, c = [1, 2, 3] >>> a, b, c (1, 2, 3) >>> a, b, c = (2 * 阅读全文
posted @ 2024-08-05 09:00 近我者赤 阅读(4) 评论(0) 推荐(0) 编辑
摘要:1.turtle绘制奥运五环图 import turtle as p def drawCircle(x,y,c='red'): p.pu()# 抬起画笔 p.goto(x,y) # 绘制圆的起始位置 p.pd()# 放下画笔 p.color(c)# 绘制c色圆环 p.circle(30,360) # 阅读全文
posted @ 2024-08-04 19:53 近我者赤 阅读(116) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示