import random myList1 = [4, 8, 12, 15, 20] myList2 = [len(myList1), 3, 5, 2, 10] numPlayers = int(input("How many people in the class?: ")) while True: t = input("Press enter for student number or q for exit") if (t == "q"): break print("Student number " + str(random.randint(1, numPlayers))) input("Press Enter for question...") n1 = random.randint(0, len(myList1) - 1) n2 = random.randint(0, len(myList2) - 1) print("myList1[" + str(n1) + "] " + "%" + " myList2[" + str(n2) + "]") input("Press enter for the answer....") print(myList1[n1]%myList2[n2]) |
Silver Announcements >