我一直在尝试编写一个代码块来查找每个项目的最大出价索引。然后我打算使用索引来识别支付这么多钱的人的名字。但是,无论我尝试什么,我都无法将这个人和他们从拍卖中获得的东西联系在一起。这是我一直在写的代码:它必须能够处理输入的任何信息
def sealedBids():
n = int(input('\nHow many people are in the group? '))#determines loop lengths
z = 0#meant to act as a counter in while loops
g = []#meant to store the names of all the people/players
s = []#meant to store name of all items being bidded on
b = []#meant to store all bids made
f = []#meant to store the each persons fair share
w = []#meant to store the highest bid for each item
q = []#trying to get it to store person linked to whatever they won
while z < n:#Process: to make the list nest lists
b.append([])
z = z + 1
z = 0
while z < n:
g.append(input('Enter a bidders name: '))#Input: Persons name
z = z + 1 #Process: store name in g[] list
z = 0
i = int(input('How many items are being bid on?'))#determines so loop lengths
while z < i:
s.append(input('Enter the name of an item: '))#input: Name of item
#process: stores names in s[] list
w.append(z)#was going to swap the info inside with the info I wanted
z = z + 1
z = 0
for j in range(n):#specifies which persons bid your taking
for k in range(i):#specifies which item is being bid on
b[j].append(int(input('How much money has {0} bid on the {1}? '.format(g[j], s[k]))))#input: takes bid for certain item
#process: stores bid in b[] list
print(' ')#adds a space when questions are being asked so it doesn't look crunched up
for j in range(n):#calculates fair share
f.append(sum(b[j])/n)#add a persons total bids then divides it by number of people bidding
for j in range(i):#meant to change the item after every bid is compared to stored highest bid
for k in range(n):#meant to change to a different persons bid to find out who bid the most money on a particular item
if w[j] < b[k][j]:#compares stored highest bid for particular item to each persons bid
w[j] = b[k][j]#if highest bid is smaller then highest bid changes to the bid that was larger
q.append(k)#trying to get it to store indentifier for whoever has highest bid so that I can use it later to link it with highest bid somehow
print(g)#meant to check outcome
print(s)#meant to check outcome
print(w)#meant to check outcome
print(q)#meant to check outcome
print(b)#meant to check outcome
print(f)#meant to check outcome
非常感谢任何建议。