2025年4月20日
摘要: 5.1 def drawaq(n): line = 3n+1 for i in range(1,line+1): if i%3 == 1: print(n"+ ",end="") print("+") else: print("| "*n,end="") print("|") n = eval(in 阅读全文
posted @ 2025-04-20 20:37 986614 阅读(30) 评论(0) 推荐(0)
  2025年4月13日
摘要: 03 假设商品总价为 price price = 19.87 抹零操作 rounded_price = int(price) print(f"抹零后的价格为: {rounded_price}") 打印学号后四位 print("学号后四位: 3034") 04 输入学生的三门成绩 score1 = f 阅读全文
posted @ 2025-04-13 14:36 986614 阅读(20) 评论(0) 推荐(0)
摘要: 假设商品总价为 price price = 19.87 抹零操作 rounded_price = int(price) print(f"抹零后的价格为: {rounded_price}") 打印学号后四位 print("学号后四位: 1234") 输入学生的三门成绩 score1 = float(i 阅读全文
posted @ 2025-04-13 14:30 986614 阅读(18) 评论(0) 推荐(0)
  2025年4月6日
摘要: 习题4.1 GuessANum.py target = 425 guess = 0 cishu = 0 while guess != target: guess = eval(input('请输入一个猜测的整数(1至1000):')) if guess > target: print('猜大了') 阅读全文
posted @ 2025-04-06 20:57 986614 阅读(30) 评论(0) 推荐(0)
  2025年3月31日
摘要: t = time.gmtime() print(time.strftime("%Y-%m-%d",t)) 3.19 import time t = time.gmtime() print(time.strftime("%Y-%m-%d",t)) print(time.strftime("%Y年%m月 阅读全文
posted @ 2025-03-31 10:32 986614 阅读(11) 评论(0) 推荐(0)
  2025年3月23日
摘要: 3.1 n = 10 weight = eval(input("请输入你的体重:")) def weight_add(year): Your_weight = weight + 0.5*year return Your_weight earth_weight = weight_add(n) lune 阅读全文
posted @ 2025-03-23 18:32 986614 阅读(37) 评论(0) 推荐(0)
  2025年3月16日
摘要: 课堂练习 TempConvert.py TempStr = input("请输入带有符号的温度值:") if TempStr[-1] in ['F','f']: C = (eval(TempStr[0:-1])-32)/1.8 print("转换后的温度是{:.2f}C".format(C)) el 阅读全文
posted @ 2025-03-16 20:14 986614 阅读(15) 评论(0) 推荐(0)
摘要: 2.1 -- coding: utf-8 -- """ Created on Sat Mar 15 09:54:37 2025 @author: xijie """ TempConvert.py TempStr = eval(input("请输入温度值:")) Fuhao = input("请输入对 阅读全文
posted @ 2025-03-16 20:12 986614 阅读(15) 评论(0) 推荐(0)
摘要: -- coding: utf-8 -- """ Created on Sat Mar 15 09:54:37 2025 @author: xijie """ TempConvert.py TempStr = eval(input("请输入温度值:")) Fuhao = input("请输入对应温度的 阅读全文
posted @ 2025-03-16 20:09 986614 阅读(10) 评论(0) 推荐(0)
  2025年3月9日
摘要: 1.str1 = input("请输入一个人的名字:") str2 = input("请输入一个国家的名字:") print("世界这么大,{}想去{}看看.".format(str1,str2)) 2.n = input("请输入整数N:") sum = 0 for i in range(int( 阅读全文
posted @ 2025-03-09 20:07 986614 阅读(12) 评论(0) 推荐(0)