I'm making a small program that pick random people in a list (a proget for school). The code works fine:
import numpy as np
people = ["0 = Baiesi", "1 = Balducci", "2 = Bulgarelli", "3 = Caffaggi", "4 = Caprara", "5 = Dodi", "6 = Fattore", "7 = Felici", '8 = Marcolin', '9 = Mascagni', '10 = Moretti', '11 = Moschini','12 = Patelli','13 = Sandu','14 = Spinelli','15 = Stevens','16 = Zani']
print(*people, sep = "\n")
n = int(input('Number of people to pick: '))
numbers = [i for i in list(range(len(people)))]
extracted = np.random.choice(numbers, size=n, replace=False)
print(extracted)
However I want it to have a specific layout, but I have no idea how to do it. I have done some research online but I didn't find anything that was suited for this case.
This is the current output:
This is the output I am looking for:
Basically I want that firstly the left "colum" with the names Is printed, than the right "colum" with the user guided part is printed near the names. I Hope I explained myself well. I was thinking of using rich module's tables
, the problem Is that this tables are printed "row by row" and not "colum by colum" (hope u understand) which is what I want.
Has someone any idea on how it could be done?
Run this program and make your modifications by following the examples...