Commit e43cebbd by BellCodeEditor

save project

parent bc621924
"['姓名', '性别', '体育项目']","['铭铭', '男', '跳远']","['徐昂', '男', '长跑']"
import turtle
a=turtle.Pen()
a.pencolor("pink")
a.pensize(60)
a.left(45)
a.forward(1000)
a.circle(50,180)
a.right(90)
a.circle(50,180)
a.forward(100)
a.penup()
a.goto(250,-240)
a.write("焕\n\n\n",font=("宋体",40,"normal"))
turtle.done()
\ No newline at end of file
姓名,性别,体育项目
铭铭,男,跳远
徐昂,男,长跑
import random
import csv
a=[["姓名","性别","体育项目"],["铭铭","男","跳远"],["徐昂","男","长跑"]]
'''with open("333.csv","w",newline="",encoding="utf-8")as file:
f=csv.writer(file)
f.writerows(a)'''
with open("333.csv","r",newline="",encoding="utf-8")as file:
f=csv.reader(file)
data=list(f)
print(data[1][2])
alist = []
for i in range(1, 101):
alist.append(i)
num = random.choice(alist)
# 请完善二分查找函数binary_search(),查找出num在列表alist里面的索引位置
def binary_search(alist,num):
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment