摘要: 任务一#include <stdio.h> #include <stdlib.h> #include <time.h> #define N 5 #define N1 397 #define N2 476 #define N3 21 int main() { int cnt; int random_m 阅读全文
posted @ 2024-10-08 18:55 王响 阅读(7) 评论(0) 推荐(0) 编辑
摘要: 任务一 #include <stdio.h> int main() { printf(" O \n"); printf("<H>\n"); printf("I I\n"); printf(" O \n"); printf("<H>\n"); printf("I I\n"); return 0; } 阅读全文
posted @ 2024-09-24 21:13 王响 阅读(44) 评论(0) 推荐(0) 编辑
摘要: 实验一 class Account: #一个模拟银行账户的简单类 def __init__(self, name, account_number,initial_amount = 10): self._name = name self._card_no = account_number self._ 阅读全文
posted @ 2023-06-11 14:07 王响 阅读(17) 评论(0) 推荐(0) 编辑
摘要: with open('data6.csv','r',encoding='gbk')as f: data=list(f.readlines()) data=[i.strip('\n') for i in data ] import decimal decimal.getcontext().roundi 阅读全文
posted @ 2023-06-05 22:15 王响 阅读(14) 评论(0) 推荐(1) 编辑
摘要: 任务1 from turtle import* def move(x,y): penup() goto(x,y) pendown() def draw(n,size=100): for i in range(n): fd(size) left(360/n) def main(): pensize(2 阅读全文
posted @ 2023-06-05 17:01 王响 阅读(13) 评论(0) 推荐(1) 编辑
摘要: print(sum) sum=42 print(sum) def inc(n): sum=n+1 print(sum) return sum sum=inc(7)+inc(7) print(sum) 1 空白 2 第二行的sum 3 函数里的sum 4 第十行的sum 任务2 def func1(a 阅读全文
posted @ 2023-05-23 19:35 王响 阅读(16) 评论(0) 推荐(1) 编辑
摘要: 任务1 import random print('用列表存储随机整数: ') lst = [random.randint(0, 100) for i in range(5)] print(lst) print('\n用集合存储随机整数: ') s1 = {random.randint(0, 100) 阅读全文
posted @ 2023-04-19 23:11 王响 阅读(45) 评论(0) 推荐(1) 编辑
摘要: 任务1 x='nba FIFA' print(x.upper()) print(x.lower()) print(x.swapcase()) print() x = 'abc' print(x.center(10,'*')) print(x.ljust(10,'*')) print(x.rjust( 阅读全文
posted @ 2023-03-22 21:55 王响 阅读(37) 评论(0) 推荐(1) 编辑
摘要: print(x,y,z) print('x = %d,y = %d,z=%d'%(x,y,z)) print('x={},y={},z={}'.format(x,y,z)) print(f'x={x},y={y},z={z}') print(x) print(y) print(z) print(x, 阅读全文
posted @ 2023-03-09 14:33 王响 阅读(43) 评论(1) 推荐(1) 编辑