所以我的代码运行并且没有任何错误,只是因为它没有做我编码的事情,它没有要求"选项"变量并跳过for循环和" num_of_details"变量,有人可以解释什么是错的吗?
def menu():
option = input("1 = Enter and store student details")
if option == 1:
num_of_details = int("How many student detail's do you wnat to add?")
database = open("database.txt","r+")
for i in range(num_of_details):
student_details()
database.write([surname,forename,date_of_birth,home_address,home_phone_number,gender,unique_ID_number,school_email])
menu()