摘要:
from turtle import* def square(size=50,rgb='orange'): pencolor(rgb) for i in range(4): fd(size) left(90) def main(): setup(800,600) speed(0) n=10 for 阅读全文
摘要:
class User: def __init__(self, name, password='111111', status='1'): # 构造新账户 self.name = name self.password = password self.status = status def info(s 阅读全文
摘要:
def is_valid(x): ls = [str(i) for i in range(0, 10)] ls.append('X') if len(x) < 18: return False for a in range(len(x)): if x[a] not in ls: return Fal 阅读全文
摘要:
with open('data3.txt','r+',encoding='utf-8')as f: a=[] for i in f: i=i.strip('\n') a.append(i) a.pop(0) b=[eval(i) for i in a] print(f'原始数据:\n{b}') c= 阅读全文
摘要:
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 阅读全文
摘要:
import random print('用列表存储随机整数: ') ls = [random.randint(1,100)for i in range(5)] print(ls) print('\n用集合存储随机整数: ') s1 = {random.randint(1,100) for i in 阅读全文
摘要:
x = list(range(10)) print('整数输出1: ',end='') for i in x: print(i,end='') print('\n整数输出2: ',end='') for i in x: print(f'{i:02d}',end='-') print('\n整数输出3 阅读全文