我的代码中有什么错误,它没有按预期工作

时间:2017-09-15 16:44:56

标签: python-3.x

所以我的代码运行并且没有任何错误,只是因为它没有做我编码的事情,它没有要求"选项"变量并跳过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()

0 个答案:

没有答案