Leading up to the momentus 2017/2018 new years ding, we couldn’t decide how to choose 10 of 50 questions in a Pub Quiz game that we picked to play. I decided to make a program to do just this, and randomise the questions. Here’s my new years python gift, to you. Have a good one!
from random import randrange def main(): numrange = [1, 51] while True: i = input() if i == "q": break else: questions(numrange) return 1 def questions(numr): questions =  for i in range(10): while True: tmp = randrange(numr, numr) if tmp not in questions: questions.append(tmp) break questions = sorted(questions) for i in questions: print(str(i)) return 1 if __name__ == "__main__": main()