摘要:
with open('data3.txt', 'r', encoding='utf-8') as f: data = f.read().split('\n') yuanben = data.pop(0) data1 = [eval(i) for i in data] data2 = [round(i 阅读全文
摘要:
1 import random 2 3 print('用列表存储随机整数:') 4 ls = [random.randint(1,100) for i in range(5)] 5 print(ls) 6 7 print('\n用集合存储随机整数:') 8 s1 = {random.randint( 阅读全文
摘要:
1 x = list(range(10)) 2 3 print('整数输出1:',end = '') 4 for i in x: 5 print(i,end='') 6 7 print('\n整数输出2:',end = '') 8 for i in x: 9 print(f'{i:02d}',end 阅读全文