-1
下面是代碼:爲什麼我的代碼跳到最後並忽略我的代碼的一部分?
print "Welcome to the Database!"
print "Simply type the correponding number to start!"
print """
1. Add a Student...
2. Search for a Student...
3. Edit a Student's Information...
4. Delete a Student...
5. Exit...
"""
datab = raw_input("What would you like to do?")
if datab == 1:
dtabs = open("database.txt", "w")
que = raw_input("What's the student's name?")
dtabs.write(que)
dtabs.close()
ttrgrp = raw_input("Which tutor group do they belog to?")
當我在終端運行它,它打印什麼會我喜歡做的,但那麼一旦輸入取在程序關閉。
'raw_input'返回非int的字符串。 –