摘要: class Account: def __init__(self, name, account_number, initial_amount = 10): self._name=name self._card_no=account_number self._balance=initial_amoun 阅读全文
posted @ 2023-06-13 15:08 曾诚 阅读(3) 评论(0) 推荐(0) 编辑
摘要: with open('data6.csv','r',encoding='gbk') as f: data = f.readlines() data1=[str(eval(data[i])) for i in range(1,len(data))] data2=[str(int(eval(data[i 阅读全文
posted @ 2023-06-05 16:22 曾诚 阅读(16) 评论(0) 推荐(0) 编辑
摘要: print(sum) sum = 42 print(sum) def inc(n): sum = n+1 print(sum) return sum sum = inc(7) + inc(7) print(sum) def func1(a,b,c,d,e,f): return[a,b,c,d,e,f 阅读全文
posted @ 2023-05-19 12:24 曾诚 阅读(10) 评论(0) 推荐(0) 编辑
摘要: import random print('用列表存储随机整数: ') lst = [random.randint(0, 100) for i in range(5)] print(lst) print('\n用集合存储随机整数: ') s1 = {random.randint(0, 100) for 阅读全文
posted @ 2023-04-22 19:41 曾诚 阅读(12) 评论(0) 推荐(0) 编辑
摘要: task 1_1.pyprint('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={},z={}'.format(x,y,z)) print( 阅读全文
posted @ 2023-04-13 23:19 曾诚 阅读(12) 评论(0) 推荐(0) 编辑
摘要: 实验一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.rju 阅读全文
posted @ 2023-03-29 00:40 曾诚 阅读(11) 评论(0) 推荐(0) 编辑