Untitled

mail@pastecode.io avatar
unknown
plain_text
19 days ago
480 B
2
Indexable
Never
import random

with open('student.txt', 'r') as file:
    content = file.read()
    print(content)

unselected_list=open('student.txt').readlines()


print(unselected_list)

print('randomly selected: ')

i=1
while unselected_list:
    input('Press Enter to select the next ID...')
    selected_id = random.choice(unselected_list)
    print(f'#{id}. {selected_id}')
    unselected_list.remove(selected_id)
    i+=1



print('All IDs have been selected.')

Leave a Comment