摘要:
一、实验任务 1.实验任务三 task3.py: 1 from turtle import * 2 def squre(size=50,rgb='orange'): 3 pencolor(rgb) 4 for i in range(4): 5 fd(size) 6 left(90) 7 def ma 阅读全文
摘要:
一、实验任务 user.py: 1 class User: 2 def __init__(self,name='guest',password='1'*6,status=1): 3 self.name=name 4 self.password=password 5 self.status=statu 阅读全文
摘要:
一、实验任务 1.实验任务3 task3.py: 1 def is_valid(ID): 2 ID=str(ID) 3 if len(str(ID))!=18: 4 return False 5 elif ID[0:17].isdigit() and (ID[17].isdigit() or ID[ 阅读全文
摘要:
一、实验内容 3.实验任务3 task3.py: 1 with open("D:\桌面\实验5数据文件\实验5数据文件\data3.txt",'r',encoding='utf-8') as f1: 2 with open("D:\桌面\实验5数据文件\实验5数据文件\data3_processed 阅读全文
摘要:
一、实验内容 1.实验任务1 task1.py: 1 print(sum) 2 sum=42 3 print(sum) 4 5 def inc(n): 6 sum=n+1 7 print(sum) 8 return sum 9 10 sum=inc(7)+inc(7) 11 print(sum) 运 阅读全文
摘要:
一、实验任务 1.实验任务1 task1.py: 1 import random 2 print('用列表存储随机整数: ') 3 ls=[random.randint(1,100) for i in range(5)] 4 print(ls) 5 6 print('\n用集合存储随机整数: ') 阅读全文
摘要:
一.实验内容 1.实验任务1 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 i 阅读全文
摘要:
1.实验任务1 task1-1.py: 1 #print输出的几种用法 2 3 #用法1:用于输出单个字符串或单个变量 4 print ('hey,u') 5 6 #用法2:用于输出多个数据项,用逗号分隔 7 print('hey,u') 8 x,y,z=1,2,3 9 print(x,y,z) 1 阅读全文