摘要: import jieba from collections import Counter 人物别名映射表 name_mapping = { "孙猴子": "孙悟空", "猴王": "孙悟空", "齐天大圣": "孙悟空", "大圣": "孙悟空", "行者": "孙悟空", "美猴王": "孙悟空" 阅读全文
posted @ 2025-06-20 20:02 kk/ 阅读(7) 评论(0) 推荐(0)
摘要: import pygame import random import sys 初始化 Pygame pygame.init() 屏幕设置 WIDTH, HEIGHT = 800, 600 screen = pygame.display.set_mode((WIDTH, HEIGHT)) pygame 阅读全文
posted @ 2025-06-17 16:46 kk/ 阅读(6) 评论(0) 推荐(0)
摘要: 在 Python 语言程序设计课程中,numpy、scipy、pandas、matplotlib有许多实际用途。我将结合基本函数用法、具体问题求解以及图像处理三个方面对其进行详细阐述报告。 一、NumPy、SciPy、Pandas、Matplotlib 基本函数用法 NumPy NumPy 是 Py 阅读全文
posted @ 2025-06-17 16:44 kk/ 阅读(2) 评论(0) 推荐(0)
摘要: import random import sys from collections import defaultdict class TableTennisGame: """乒乓球比赛模拟类""" def init(self): self.player1 = None self.player2 = 阅读全文
posted @ 2025-06-17 16:37 kk/ 阅读(1) 评论(0) 推荐(0)
摘要: import pygame import random import sys 初始化pygame pygame.init() 屏幕设置 WIDTH, HEIGHT = 800, 600 screen = pygame.display.set_mode((WIDTH, HEIGHT)) pygame. 阅读全文
posted @ 2025-06-17 15:36 kk/ 阅读(4) 评论(0) 推荐(0)
摘要: Python语言程序设计学习心得体会 作为一名大一学生,结束了一学期的Python语言程序设计课程学习后,我对编程世界的认知发生了翻天覆地的变化,这段学习经历也成为我大学探索之旅中意义非凡的开端。 初次接触Python,其简洁的语法规则就像一把打开编程大门的钥匙。记得第一次敲下 print("Hel 阅读全文
posted @ 2025-06-17 15:26 kk/ 阅读(4) 评论(0) 推荐(0)
摘要: 8.1 import random def ping_pong_match(): player1_score = 0 player2_score = 0 while True: # 随机决定得分方 winner = random.choice([1, 2]) if winner == 1: play 阅读全文
posted @ 2025-05-24 14:07 kk/ 阅读(12) 评论(0) 推荐(0)
摘要: 7.1 def rewrite_py_file(file_path): try: with open(file_path, 'r', encoding='utf - 8') as f: content = f.read() new_content = "" i = 0 while i < len(c 阅读全文
posted @ 2025-05-19 12:43 kk/ 阅读(11) 评论(0) 推荐(0)
摘要: import turtle import time import datetime COLORS = { 'year': 'red', 'month': 'blue', 'day': 'green', 'hour': 'purple', 'minute': 'orange' } DIGIT_SEGM 阅读全文
posted @ 2025-05-04 15:18 kk/ 阅读(5) 评论(0) 推荐(0)
摘要: import random def genpwd(length): # 生成一个长度为length的数字密码 password = '' for _ in range(length): password += str(random.randint(0, 9)) # 生成0-9的随机数字 return 阅读全文
posted @ 2025-04-26 22:17 kk/ 阅读(9) 评论(0) 推荐(0)