摘要:
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 阅读全文
摘要:
class User: def __init__(self,name='guest',password=111111,status=1): self.name=name self.password=password self.status=status def info(self): print(' 阅读全文
摘要:
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 阅读全文
摘要:
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"原始数据: 阅读全文
摘要:
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作用域为 阅读全文
摘要:
# task1.py import random print('用列表存储随机整数: ') Is = [random.randint(1,100)for i in range(5)] print(Is) print('\n用集合存储随机整数:') s1 = {random.randint(1,100 阅读全文
摘要:
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 = 阅读全文
摘要:
# 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 阅读全文