摘要:
from turtle import * def square(size=50, rgb='pink'): '''绘制正方形 参数size指定边长 参数rgb指定画笔颜色 如果没有给参数,采用默认值 ''' pencolor('purple') for i in range(4): fd(size) 阅读全文
摘要:
task3.py def is_valid(x): if len(x)==18: if x.isdigit() or( x[:-1].isdigit() and x[-1]=='X'): return True else: return False else: return False with o 阅读全文
摘要:
任务三: with open('data3.txt','r+', encoding='UTF-8') as f: Z=[] Y=[] x=[] for i in f: x.append(i.strip('\n')) newx=x[1:11] for i in newx: y=float(i) Y.a 阅读全文
摘要:
1. import random print('\n用集合存储随机整数:') ls=[random.randint(1,100) for i in range(5)] print(ls) print('\n用集合存储随机整数:') s1={random.randint(1,100) for i in 阅读全文
摘要:
任务一 task1.py 1 x = list(range(10)) 2 print('整数输出1: ', end = '') 3 for i in x: 4 print(i, end=' ') 5 print('\n整数输出2: ', end = '') 6 for i in x: 7 print 阅读全文