我现在在excel有以下格式的题
我要怎样编写程序可以实现随机抽取其中的题并且显示出来?
可以先获取数量,然后随机访问一个
import random
from pandas import read_excel
fp='11.xlsx'
tabel1 = read_excel(fp, sheet_name='Sheet1')
print(tabel1)
print(tabel1.shape[0])
n=random.randint(0,tabel1.shape[0])
print(tabel1.loc[n])
print(tabel1.loc[n].题目,tabel1.loc[n].a,tabel1.loc[n].b,tabel1.loc[n].c,tabel1.loc[n].d)
我的表是这样的