2025年6月23日
摘要: Python学习心得体会 初识Python的惊喜 最初接触Python时,我被它简洁优雅的语法深深吸引。相比其他编程语言,Python代码更加直观易懂,这大大降低了编程的入门门槛。记得第一次用Python打印"Hello World"时,只需要一行简单的print("Hello World"),这种 阅读全文
posted @ 2025-06-23 13:07 986614 阅读(15) 评论(0) 推荐(0)
摘要: 点击查看代码 import pygame import random import sys # 初始化pygame pygame.init() # 屏幕设置 SCREEN_WIDTH = 800 SCREEN_HEIGHT = 600 screen = pygame.display.set_mode 阅读全文
posted @ 2025-06-23 13:05 986614 阅读(22) 评论(0) 推荐(0)
  2025年6月22日
摘要: 游戏开始 游戏过程 游戏结束 点击查看代码 import pygame import sys import random # 初始化pygame try: pygame.init() print("Pygame初始化成功") except Exception as e: print(f"Pygame 阅读全文
posted @ 2025-06-22 15:17 986614 阅读(60) 评论(0) 推荐(0)
摘要: import pygame import sys import random Initialize pygame pygame.init() Game constants SCREEN_WIDTH = 800 SCREEN_HEIGHT = 400 GROUND_HEIGHT = 350 GRAVI 阅读全文
posted @ 2025-06-22 13:20 986614 阅读(10) 评论(0) 推荐(0)
  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 阅读(25) 评论(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 阅读(10) 评论(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 阅读(11) 评论(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 阅读(26) 评论(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 阅读(8) 评论(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 阅读(31) 评论(0) 推荐(0)