摘要: 等边三角形的绘制 from turtle import * penup() fd(-50) pendown() pensize(25) seth(60) fd(100) seth(-60) fd(100) seth(360) fd(-100) done() 运行结果如下: 阅读全文
posted @ 2023-10-19 11:08 Jinylin 阅读(70) 评论(0) 推荐(0) 编辑
摘要: 汇率转换程序 i = input("请输入金额用“¥”或“$”结束:") if i[-1] in ['¥']: C = (eval(i[0:-1])) / 6 print("转换后是{:.2f}美元".format(C)) elif i[-1] in ['$']: F = (eval(i[0:-1] 阅读全文
posted @ 2023-10-19 11:06 Jinylin 阅读(66) 评论(0) 推荐(0) 编辑
摘要: 太阳花的绘制 from turtle import * color('red', 'yellow') # 分别定义填充颜色 begin_fill() while True: forward(200) left(170) # noinspection PyTypeChecker if abs(pos( 阅读全文
posted @ 2023-10-19 11:04 Jinylin 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 五角星的绘制 from turtle import * # 从turtle库中导入所有函数 fillcolor("red") # 表示填充红色 begin_fill() # 表示开始填充 while True: # 条件为真时进行死循环 forward(200) right(144) # noins 阅读全文
posted @ 2023-10-19 11:01 Jinylin 阅读(29) 评论(0) 推荐(0) 编辑
摘要: 健康食谱搭配输出 diet = ['西红柿', '花椰菜', '黄瓜', '牛排', '虾仁'] for x in range(0, 5): for y in range(0, 5): if not (x == y): print("{}{}".format(diet[x], diet[y])) 程 阅读全文
posted @ 2023-10-19 10:54 Jinylin 阅读(148) 评论(0) 推荐(0) 编辑