A program that decides the president from ATND participants. Please download the ATND Participant CSV and use it as appropriate.
It is used when delivering food at ATND to avoid the situation of sushi, pizza, curry, etc.
The decision-maker is randomly determined based on the vote. That is the president. Assuming an infinite number of trials, democracy is more likely to reflect the will of the voters than majority democracy. The motif is the rule of the Phantom Troupe, "The law of the members is serious. If you fight, you will decide with coins."
meshi.py
#!/usr/bin/python
# coding: UTF-8
import csv
import random
filename = "entry.csv"
csvfile = open(filename)
list = []
for row in csv.reader(csvfile):
if row[0] != "name":
list.append(row[0])
csvfile.close()
print random.sample(list,1)[0]
Recommended Posts