I want to write a program that can randomly allocate seats. The name and the seat are in two columns of the CSV file, I want to randomly select them and print them. I will only read one column at random. How do I write two columns of data at random?
#read name column at random with open('/home/name.csv', 'r') as fp: for l in fp: foo = list(fp) name = random.choice(foo) print(name) #This is data in csv column0 column1 Jacob 2A Tony 3B Emma 1C Jack 5D Ada 4A
Now i want to random choice Name and Place at same time and print it, but i don't know how to write it.