摘要: 7.2 import jieba import wordcloud import numpy as np from PIL import Image fname = "第十周\三国演义.txt" with open(fname, "r", encoding="utf-8") as f: ls = j 阅读全文
posted @ 2025-05-18 10:38 你好book 阅读(45) 评论(0) 推荐(0)
摘要: import turtle import datetime def draw_line(draw): """绘制单段数码管""" turtle.pendown() if draw else turtle.penup() turtle.forward(40) turtle.right(90) def 阅读全文
posted @ 2025-05-05 20:10 你好book 阅读(15) 评论(0) 推荐(0)
摘要: 田字格输出 n = eval(input('请输入一个奇数:')) a,b,c,d = '-','+','|',' ' m = n//2 if n%2 == 1: for i in range(n): if i in [0,m,n-1]: print('{0}{1}{0}{1}{0}'.format 阅读全文
posted @ 2025-04-20 15:01 你好book 阅读(30) 评论(0) 推荐(0)
摘要: GuessANum.py import random secret = random.randint(1, 100) guesscuonts = 0 # 记录玩家猜的次数。 print(" 猜数字游戏 ") guess = eval(input("请输入1-100的整数:")) while True 阅读全文
posted @ 2025-03-31 21:30 你好book 阅读(79) 评论(0) 推荐(0)
摘要: 3.19 import time t = time.gmtime() print(time.strftime("%Y-%m-%d",t)) 3.20 import time t = time.gmtime() print(time.strftime("%Y-%m-%d",t)) print(time 阅读全文
posted @ 2025-03-30 14:45 你好book 阅读(15) 评论(0) 推荐(0)
摘要: 重量计算,月球上物体的体重是在地球上的16.5%,假如你在地球上每年增长0.5kg,编写程序输出未来10年你在地球和月球上的体重状况。 current_weight = float(input('当前体重kg:')) for i in range(1,11): current_weight += 0 阅读全文
posted @ 2025-03-23 16:02 你好book 阅读(42) 评论(0) 推荐(0)
摘要: 标识符放在温度后,输出为整数 TempStr = input("请输入带有符号的温度值:") if TempStr[-1] in ['f','F']: C = (eval(TempStr[0:-1]) - 32)/1.8 print("转化后的温度是{:.0f}21c" "C".format(C)) 阅读全文
posted @ 2025-03-16 11:12 你好book 阅读(87) 评论(0) 推荐(0)
摘要: 蟒蛇绘制 import turtle turtle.setup(650, 350, 200, 200) turtle.penup() turtle.fd(-250) turtle.pendown() turtle.pensize(25) turtle.pencolor("purple") turtl 阅读全文
posted @ 2025-03-16 11:07 你好book 阅读(9) 评论(0) 推荐(0)
摘要: 标识符放在温度后 TempStr = input("请输入带有符号的温度值:") if TempStr[-1] in ['f','F']: C = (eval(TempStr[0:-1]) - 32)/1.8 print("转化后的温度是{:.2f}C".format(C)) elif TempSt 阅读全文
posted @ 2025-03-16 11:02 你好book 阅读(26) 评论(0) 推荐(0)
摘要: ChatGPT使用方法: 输入书籍或文章内容。 使用指令(如“请生成摘要”或“回答以下问题”)与模型交互。 获取生成的内容(摘要、答案、笔记等)。 特点: 支持长文本输入和复杂指令。 生成内容较为详细,适合深度阅读。 Google Bard使用方法: 输入书籍内容或问题。 模型快速生成简洁的回答或摘 阅读全文
posted @ 2025-03-08 19:16 你好book 阅读(154) 评论(0) 推荐(0)