摘要: 1.1 Numpy 基本概念与核心数据结构 Numpy (Numerical Python) 是 Python 科学计算的基础库,提供了高性能的多维数组对象ndarray,以及大量操作数组的函数。ndarray是 Numpy 的核心数据结构,具有以下特点: 所有元素类型相同 内存连续存储,访问效率高 阅读全文
posted @ 2025-06-23 15:33 穆斯221 阅读(5) 评论(0) 推荐(0)
摘要: 初识 Python 时,我便被它简洁易读的语法所吸引。不同于其他编程语言复杂的符号和结构,Python 以近乎自然语言的方式呈现代码,让初学者能够快速理解编程逻辑。这种 “所见即所得” 的特性,极大地降低了我对编程的畏惧感,也让我在入门阶段就能够顺利编写一些简单的程序,如输出 “Hello Worl 阅读全文
posted @ 2025-06-22 22:14 穆斯221 阅读(0) 评论(0) 推荐(0)
摘要: import pygame import random import sys import math from typing import List, Dict, Tuple, Optional 初始化pygame try: pygame.init() except Exception as e: 阅读全文
posted @ 2025-06-22 22:12 穆斯221 阅读(0) 评论(0) 推荐(0)
摘要: import pygame import random import sys import math from typing import List, Dict, Tuple, Optional 初始化pygame try: pygame.init() except Exception as e: 阅读全文
posted @ 2025-06-22 21:58 穆斯221 阅读(4) 评论(0) 推荐(0)
摘要: 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-21 22:14 穆斯221 阅读(22) 评论(0) 推荐(0)
摘要: GuessANum.py target = 425 guess = 0 cishu = 0 while guess != target: guess = eval(input('请输入一个猜测的整数(1至1000):')) if guess > target: print('猜大了') cishu 阅读全文
posted @ 2025-04-08 22:54 穆斯221 阅读(12) 评论(0) 推荐(0)
摘要: import time t = time.gmtime() print(time.strftime("%Y-%m-%d",t)) import time t = time.gmtime() print(time.strftime("%Y-%m-%d",t)) print(time.strftime( 阅读全文
posted @ 2025-03-31 10:35 穆斯221 阅读(12) 评论(0) 推荐(0)
摘要: 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-24 11:49 穆斯221 阅读(5) 评论(0) 推荐(0)
摘要: TempStr = input("请输入带有符号的温度值 : ") if TempStr[0] in ['F','f']: C = (eval(TempStr[1:]) - 32)/1.8 print("转换后的温度是C{:.2f}".format(C)) elif TempStr[0:2] in 阅读全文
posted @ 2025-03-17 10:57 穆斯221 阅读(3) 评论(0) 推荐(0)
摘要: -- coding: utf-8 -- """ Created on Mon Mar 17 10:44:01 2025 @author: ASUS """ TempConvert.py TempStr = eval(input("请输入温度值:")) Fuhao = input("请输入对应温度的符 阅读全文
posted @ 2025-03-17 10:56 穆斯221 阅读(2) 评论(0) 推荐(0)