上一页 1 ··· 4 5 6 7 8 9 下一页
摘要: 华氏温度转换为摄氏度的温度转换程序共有三种写法 一、简单的温度转换程序 TempStr = input("请输入带有符号的温度值: ") # TemStr表示命令,表示占位符。=为赋值符号。 if TempStr[-1] in ['F', 'f']: C = (eval(TempStr[0:-1]) 阅读全文
posted @ 2023-10-19 01:34 Jinylin 阅读(354) 评论(0) 推荐(0) 编辑
摘要: 日期和时间的输出 from datetime import datetime # 引用datetime 库 now = datetime.now() # 获得当前日期和时间信息 print(now) print("{}".format(now.strftime("%x"))) # 输出其中的日期部分 阅读全文
posted @ 2023-10-19 01:23 Jinylin 阅读(15) 评论(0) 推荐(0) 编辑
摘要: 绘制同切圆 import turtle # 引用turtle 库 turtle.pensize(2) # 设置画笔宽度为2 像素 turtle.circle(10) # 绘制半径为10 像素的圆 turtle.circle(40) # 绘制半径为40 像素的圆 turtle.circle(80) # 阅读全文
posted @ 2023-10-19 01:10 Jinylin 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 斐波那契数列的计算 a, b = 0, 1 while a < 1000: # 输出不大于1000 的序列。while表示循环 print(a, end=',') a, b = b, a + b 阅读全文
posted @ 2023-10-19 00:58 Jinylin 阅读(20) 评论(0) 推荐(0) 编辑
摘要: 一个简单的人机对话程序 name = input("输入姓名:") # input输入数据 print("{}同学,学好Python,前途无量!".format(name)) print("{} 大侠,学好Python,大展拳脚!".format(name[0])) # 0指前面输入的数据当中的第一 阅读全文
posted @ 2023-10-19 00:54 Jinylin 阅读(85) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 下一页