摘要: from turtle import* setup(800,600) speed(0) pencolor('pink') n=10 for i in range(n): for j in range(2): circle(80,90) left(90) right(360/n) hideturtle 阅读全文
posted @ 2022-06-13 21:10 10309 阅读(8) 评论(0) 推荐(0) 编辑
摘要: class User: def __init__(self,name='guest',password=111111,status=1): self.name=name self.password=password self.status=status def info(self): print(' 阅读全文
posted @ 2022-06-06 21:00 10309 阅读(6) 评论(0) 推荐(0) 编辑
摘要: task3def 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 阅读全文
posted @ 2022-05-21 02:17 10309 阅读(6) 评论(1) 推荐(0) 编辑
摘要: with open('data3.txt','r+', encoding='UTF-8') as f: num = [line.strip('\n') for line in f] num.pop(0) num_print = [eval(i) for i in num] print(f"原始数据: 阅读全文
posted @ 2022-05-16 23:14 10309 阅读(9) 评论(2) 推荐(0) 编辑
摘要: print(sum) sum = 42 print(sum) def inc(n): sum = n+1 print(sum) return sum sum = inc(7) + inc(7) print(sum) 不是 line1作用域为line1 line3作用域为line2 line7作用域为 阅读全文
posted @ 2022-05-09 12:36 10309 阅读(5) 评论(0) 推荐(0) 编辑
摘要: # task1.py import random print('用列表存储随机整数: ') Is = [random.randint(1,100)for i in range(5)] print(Is) print('\n用集合存储随机整数:') s1 = {random.randint(1,100 阅读全文
posted @ 2022-05-01 22:43 10309 阅读(8) 评论(2) 推荐(0) 编辑
摘要: 1.task1 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 = 阅读全文
posted @ 2022-04-12 16:39 10309 阅读(12) 评论(3) 推荐(0) 编辑
摘要: # task1_1.py 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 = {}, z = {}'.f 阅读全文
posted @ 2022-03-30 00:58 10309 阅读(15) 评论(4) 推荐(0) 编辑