会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
klbbb
博客园
首页
新随笔
联系
订阅
管理
2025年11月21日
文字识别
摘要: import torch import torch.nn as nn import torch.nn.functional as F import os from torchvision.transforms.functional import to_tensor, rgb_to_grayscale
阅读全文
posted @ 2025-11-21 00:09 kkkk0515
阅读(0)
评论(0)
推荐(0)
2025年6月23日
游戏代码
摘要: import random import time def show_title(): """显示游戏标题""" print("=" * 40) print(" 欢迎来到猜数字小游戏 ") print("=" * 40) print("规则:系统会随机生成一个数字,你需要在有限次数内猜中它!") p
阅读全文
posted @ 2025-06-23 14:22 kkkk0515
阅读(38)
评论(0)
推荐(0)
模拟体育竞技分析
摘要: import random def simulate_game(prob_a, prob_b): """模拟一局比赛,返回胜者(A或B)""" score_a, score_b = 0, 0 while True: # 随机决定得分方,prob_a为A得分概率 if random.random()
阅读全文
posted @ 2025-06-23 13:44 kkkk0515
阅读(29)
评论(0)
推荐(0)
Jieba分词
摘要: import jieba from collections import Counter import re 读取《西游记》文本(假设文件名为'西游记.txt') try: with open('西游记.txt', 'r', encoding='utf-8') as f: content = f.r
阅读全文
posted @ 2025-06-23 13:40 kkkk0515
阅读(14)
评论(0)
推荐(0)
2025年3月17日
第二章习题
摘要: dollar = eval(input("请输入美元金额:")) rmb = int(dollar * 6.) print("对应的人民币金额是:", rmb) while True: choice = input("请选择兑换方向:1. 美元兑换人民币 2. 人民币兑换美元(输入1或2):") i
阅读全文
posted @ 2025-03-17 23:16 kkkk0515
阅读(36)
评论(0)
推荐(0)
2025年3月9日
44页习题
摘要: from turtle import * color('red', 'yellow') begin_fill() while True: forward(200) left(170) if abs(pos()) < 1: break end_fill() done()
阅读全文
posted @ 2025-03-09 22:31 kkkk0515
阅读(11)
评论(0)
推荐(0)
大模型读书报告
摘要: class BigModelReport: def init(self, title, author, date): self.title = title self.author = author self.date = date self.sections = { "Introduction":
阅读全文
posted @ 2025-03-09 22:19 kkkk0515
阅读(23)
评论(0)
推荐(0)
2025年2月25日
绘制五角星
摘要: import turtle pen = turtle.Turtle() pen.speed(3) for _ in range(5): pen.forward(100) pen.right(144) turtle.done
阅读全文
posted @ 2025-02-25 09:38 kkkk0515
阅读(11)
评论(0)
推荐(0)
公告