会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
zcdebky
博客园
首页
新随笔
联系
订阅
管理
2023年6月14日
实验7 面向对象编程与内置模块
摘要: 实验结论 实验任务1 程序源代码 class Account: '''一个模拟银行账户的简单类''' def __init__(self, name, account_number, initial_amount = 10): '''构造新账户''' self._name = name self._
阅读全文
posted @ 2023-06-14 00:02 气工朱聪
阅读(17)
评论(0)
推荐(0)
2023年6月8日
实验6 turtle绘图与python库应用编程体验
摘要: 实验结论 实验任务1 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)
阅读全文
posted @ 2023-06-08 17:00 气工朱聪
阅读(52)
评论(0)
推荐(0)
2023年6月6日
实验5 文件应用编程
摘要: 实验结论 实验任务6 程序源代码 with open('data6.csv','r',encoding='gbk') as f: data1 = f.read().split('\n') del data1[0] for i in range(len(data1)): data1[i] = eval
阅读全文
posted @ 2023-06-06 20:36 气工朱聪
阅读(17)
评论(0)
推荐(0)
2023年5月23日
实验4 函数与异常处理编程
摘要: 实验结论 实验任务1 程序源代码 print(sum) sum = 42 print(sum) def inc(n): sum = n+1 print(sum) return sum sum = inc(7) + inc(7) print(sum) 运行测试截图 问题回答:不是同一个对象的名称。li
阅读全文
posted @ 2023-05-23 20:14 气工朱聪
阅读(47)
评论(0)
推荐(0)
2023年4月25日
实验3 控制语句与组合数据类型应用编程
摘要: 实验结论 实验1 程序源代码 import random print('用列表存储随机整数: ') lst = [random.randint(0, 100) for i in range(5)] print(lst) print('\n用集合存储随机整数: ') s1 = {random.rand
阅读全文
posted @ 2023-04-25 00:24 气工朱聪
阅读(26)
评论(0)
推荐(0)
2023年3月27日
实验2 字符串和列表
摘要: 实验结论 实验任务1 程序源代码 x = 'nba FIFA' print(x.upper()) print(x.lower()) print(x.swapcase()) print() x = 'abc' print(x.center(10, '*')) print(x.ljust(10, '*'
阅读全文
posted @ 2023-03-27 18:01 气工朱聪
阅读(21)
评论(0)
推荐(0)
2023年3月14日
实验1
摘要: 实验结论 实验任务1 1-1程序源代码 #print输出的几种用法 print('hey,u') print('hey','u') x,y,z = 1,2,3 print(x,y,z) print('x = %d,y = %d,z = %d'%(x,y,z)) print('x = {},y = {
阅读全文
posted @ 2023-03-14 10:03 气工朱聪
阅读(37)
评论(0)
推荐(0)
公告