Code: Select all
import random
import os
students_in_classes = [
["Jake", "Kim", "Lee"],
["Pol", "Laa","Deng"],
["Sam", "Pen", "Wom"],
["Ree", "Asen", "Rom"],
["Kim", "Alex", "Kris"]
]
def random_student ():
print(random.choice(new_class))
def clear_screen():
os.system("cls" if os.name == "nt" else "clear")
def show_classes ():
index = 1
for classes in students_in_classes:
print("{}.".format(index), classes)
index += 1
show_classes()
class_number = input("What is the number of the class of which you're teaching? ")
clear_screen()
new_class = students_in_classes[int(class_number) - 1]
print("Your class:")
print(new_class)
x = input("Press ENTER to randomly select a student")
if x == x:
random_student()