0
所以我正在做一個測驗蟒蛇程序,它似乎有一些問題與我的程序。 第一次如果你想開始測驗,測驗將開始並打印出像普通測驗那樣的問題,當你回答正確的問題時,我會給你點數。然而 測驗結束後,你想再做一次測驗,這就是問題的開始,當我要開始測驗,問題不打印出來字符串不能從文本文件打印
while True:
print('1. Take test, 2. Add Question, 3. Modify, 4. Delete, 5. Exit')
n=input('Choice: ')
counter=0
lines=q.readlines()
liness=p.read()
key=liness.split('\n')
while n not in ('1','2','3','4','5'):
print('Invalid Choice')
n=input('Choice: ')
if n=='1':
score=0
counter=0
n=0
nb=0
while True:
linez=lines[n:n+5]
for line in linez:
print(line)
b=CheckAnswer()
if b==key[nb]:
score=score+1
print('Nice')
n=n+6
nb=nb+1
counter=counter+1
print('Current Score: ',score)
if counter>=len(key):
break
誰能幫助我解決這個問題?
什麼是p和q? – jmilloy