摘要: ``import tensorflow as tf from tensorflow.keras.datasets import cifar10 from tensorflow.keras.models import Sequential from tensorflow.keras.layers im 阅读全文
posted @ 2025-10-24 00:31 无聊了多少人 阅读(5) 评论(0) 推荐(0)
摘要: PyTorch是由Facebook开发并开源的深度学习框架,广泛应用于计算机视觉、自然语言处理、推荐系统等领域。PyTorch以其灵活的动态图(Dynamic Computational Graph)、简洁的API、强大的自动微分(Autograd)能力、丰富的内置模型与优化算法而著称。张量(Ten 阅读全文
posted @ 2025-10-23 23:38 无聊了多少人 阅读(5) 评论(0) 推荐(0)
摘要: import jieba from collections import Counter 读取《红楼梦》文本 with open("hongloumeng.txt", "r", encoding="utf-8") as f: text = f.read() 使用jieba分词 words = jie 阅读全文
posted @ 2025-06-23 14:50 无聊了多少人 阅读(10) 评论(0) 推荐(0)
摘要: import pygame import sys import random 初始化pygame pygame.init() 游戏常量 CELL_SIZE = 30 MARGIN = 10 中等难度设置(可调整) GRID_WIDTH = 16 GRID_HEIGHT = 16 MINE_COUNT 阅读全文
posted @ 2025-06-22 22:02 无聊了多少人 阅读(19) 评论(0) 推荐(0)
摘要: #5.1 字符田字格绘制 def TianZiGe(n): a = 5*n+1 for i in range(1,a+1): if i%5 == 1: print("+ " * n+"+") else: print("| " * n+"|") def main(): n = int(input("请 阅读全文
posted @ 2025-04-22 00:54 无聊了多少人 阅读(28) 评论(0) 推荐(0)
摘要: ``num = 389 二进制 binary = bin(num) print(f"二进制: {binary}") 八进制 octal = oct(num) print(f"八进制: {octal}") 十进制 decimal = str(num) print(f"十进制: {decimal}") 阅读全文
posted @ 2025-03-31 11:52 无聊了多少人 阅读(6) 评论(0) 推荐(0)
摘要: 2.1整数温度转换器 TempStr = input("请输入带有符号的温度值:") if isinstance(TempStr, str) and TempStr[-1] in ['F', 'f']: C = int((float(TempStr[0:-1]) - 32) / 1.8) print 阅读全文
posted @ 2025-03-17 10:11 无聊了多少人 阅读(6) 评论(0) 推荐(0)
摘要: import turtle turtle.setup(600, 400) turtle.speed(10) turtle.penup() turtle.goto(-300, 200) turtle.pendown() turtle.color("red") turtle.begin_fill() f 阅读全文
posted @ 2025-02-25 09:32 无聊了多少人 阅读(4) 评论(0) 推荐(0)
摘要: from turtle import* fillcolor("red") begin_fill() while True: forward(200) right(144) if abs(pos())<1: break end_fill() 阅读全文
posted @ 2025-02-25 09:09 无聊了多少人 阅读(6) 评论(0) 推荐(0)