import csv
import random
#数据读入
f=open("name.csv","r")
flines=csv.reader(f)
name_list=[]
m=6 #班级总数
total=18 #参赛总人数
for line in flines:
name list.append(line)
flag=[False]*n
grade=[3]*m
i=0
while i<total:
p=random.randint(, )
bj=int(name_list[p][0])
if flag[p]=False:
if grade[bj-1]>0:
flag[p]=True
i+=1
print("抽取名单为:")
print(”班级","姓名")
for i in range(n):
if flag[i]:
print(name_list[i][0],name_list[i][1])
f.close()