91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

基于Python怎么編寫一個刷題練習系統

發布時間:2023-02-24 14:54:08 來源:億速云 閱讀:231 作者:iii 欄目:開發技術

這篇“基于Python怎么編寫一個刷題練習系統”文章的知識點大部分人都不太理解,所以小編給大家總結了以下內容,內容詳細,步驟清晰,具有一定的借鑒價值,希望大家閱讀完這篇文章能有所收獲,下面我們一起來看看這篇“基于Python怎么編寫一個刷題練習系統”文章吧。

實現效果

基于Python怎么編寫一個刷題練習系統

實現代碼

選擇題

def xuanze():
    global flag2
    if flag2==1:
        def insert():
            num=var1.get()
            question=var2.get()
            choice=var3.get()
            answer=var4.get()
            with open('d:\\練習系統\\練習三3.1.pickle','rb') as file:
                lst1=pickle.load(file)
            with open('d:\\練習系統\\練習三3.2.pickle','rb') as file:
                lst2=pickle.load(file)
            with open('d:\\練習系統\\練習三3.3.pickle','rb') as file:
                lst3=pickle.load(file)
            with open('d:\\練習系統\\練習三3.4.pickle','rb') as file:
                lst4=pickle.load(file)
            if num not in lst1:
                lst1.append(num)
                lst2.append(question)
                lst3.append(choice)
                lst4.append(answer)
                var5.set('錄入成功')
            else:
                var5.set('錄入失敗')
            with open('d:\\練習系統\\練習三3.1.pickle','wb') as file:
                pickle.dump(lst1,file)
                file.close()
            with open('d:\\練習系統\\練習三3.2.pickle','wb') as file:
                pickle.dump(lst2,file)
                file.close()
            with open('d:\\練習系統\\練習三3.3.pickle','wb') as file:
                pickle.dump(lst3,file)
                file.close()
            with open('d:\\練習系統\\練習三3.4.pickle','wb') as file:
                pickle.dump(lst4,file)
                file.close()
        def delete():
            num=var1.get()
            question=var2.get()
            choice=var3.get()
            answer=var4.get()
            with open('d:\\練習系統\\練習三3.1.pickle','rb') as file:
                lst1=pickle.load(file)
            with open('d:\\練習系統\\練習三3.2.pickle','rb') as file:
                lst2=pickle.load(file)
            with open('d:\\練習系統\\練習三3.3.pickle','rb') as file:
                lst3=pickle.load(file)
            with open('d:\\練習系統\\練習三3.4.pickle','rb') as file:
                lst4=pickle.load(file)
            if num in lst1:
                t=lst1.index(num)
                lst1.pop(t)
                lst2.pop(t)
                lst3.pop(t)
                lst4.pop(t)
                var5.set('刪除成功')
            else:
                var5.set('刪除失敗')
            with open('d:\\練習系統\\練習三3.1.pickle','wb') as file:
                pickle.dump(lst1,file)
                file.close()
            with open('d:\\練習系統\\練習三3.2.pickle','wb') as file:
                pickle.dump(lst2,file)
                file.close()
            with open('d:\\練習系統\\練習三3.3.pickle','wb') as file:
                pickle.dump(lst3,file)
                file.close()
            with open('d:\\練習系統\\練習三3.4.pickle','wb') as file:
                pickle.dump(lst4,file)
                file.close()

填空題

def tiankong():
    global flag2
    if flag2==1:
        def insert():
            num=var1.get()
            question=var2.get()
            answer=var3.get()
            with open('d:\\練習系統\\練習一1.1.pickle','rb') as file:
                lst1=pickle.load(file)
            with open('d:\\練習系統\\練習一1.2.pickle','rb') as file:
                lst2=pickle.load(file)
            with open('d:\\練習系統\\練習一1.3.pickle','rb') as file:
                lst3=pickle.load(file)
            if num not in lst1:
                lst1.append(num)
                lst2.append(question)
                lst3.append(answer)
                var4.set('錄入成功')
            else:
                var4.set('錄入失敗')
            with open('d:\\練習系統\\練習一1.1.pickle','wb') as file:
                pickle.dump(lst1,file)
                file.close()
            with open('d:\\練習系統\\練習一1.2.pickle','wb') as file:
                pickle.dump(lst2,file)
                file.close()
            with open('d:\\練習系統\\練習一1.3.pickle','wb') as file:
                pickle.dump(lst3,file)
                file.close()
        def delete():
            num=var1.get()
            question=var2.get()
            answer=var3.get()
            with open('d:\\練習系統\\練習一1.1.pickle','rb') as file:
                lst1=pickle.load(file)
            with open('d:\\練習系統\\練習一1.2.pickle','rb') as file:
                lst2=pickle.load(file)
            with open('d:\\練習系統\\練習一1.3.pickle','rb') as file:
                lst3=pickle.load(file)
            if num in lst1:
                t=lst1.index(num)
                lst1.pop(t)
                lst2.pop(t)
                lst3.pop(t)
                var4.set('刪除成功')
            else:
                var4.set('刪除失敗')
            with open('d:\\練習系統\\練習一1.1.pickle','wb') as file:
                pickle.dump(lst1,file)
                file.close()
            with open('d:\\練習系統\\練習一1.2.pickle','wb') as file:
                pickle.dump(lst2,file)
                file.close()
            with open('d:\\練習系統\\練習一1.3.pickle','wb') as file:
                pickle.dump(lst3,file)
                file.close()

判斷題

def panduan():
    global flag2
    if flag2==1:
        def insert():
            num=var1.get()
            question=var2.get()
            answer=var3.get()
            with open('d:\\練習系統\\練習二2.1.pickle','rb') as file:
                lst1=pickle.load(file)
            with open('d:\\練習系統\\練習二2.2.pickle','rb') as file:
                lst2=pickle.load(file)
            with open('d:\\練習系統\\練習二2.3.pickle','rb') as file:
                lst3=pickle.load(file)
            if num not in lst1:
                lst1.append(num)
                lst2.append(question)
                lst3.append(answer)
                var4.set('錄入成功')
            else:
                var4.set('錄入失敗')
            with open('d:\\練習系統\\練習二2.1.pickle','wb') as file:
                pickle.dump(lst1,file)
                file.close()
            with open('d:\\練習系統\\練習二2.2.pickle','wb') as file:
                pickle.dump(lst2,file)
                file.close()
            with open('d:\\練習系統\\練習二2.3.pickle','wb') as file:
                pickle.dump(lst3,file)
                file.close()
        def delete():
            num=var1.get()
            question=var2.get()
            answer=var3.get()
            with open('d:\\練習系統\\練習二2.1.pickle','rb') as file:
                lst1=pickle.load(file)
            with open('d:\\練習系統\\練習二2.2.pickle','rb') as file:
                lst2=pickle.load(file)
            with open('d:\\練習系統\\練習二2.3.pickle','rb') as file:
                lst3=pickle.load(file)
            if num in lst1:
                t=lst1.index(num)
                lst1.pop(t)
                lst2.pop(t)
                lst3.pop(t)
                var4.set('刪除成功')
            else:
                var4.set('刪除失敗')
            with open('d:\\練習系統\\練習二2.1.pickle','wb') as file:
                pickle.dump(lst1,file)
                file.close()
            with open('d:\\練習系統\\練習二2.2.pickle','wb') as file:
                pickle.dump(lst2,file)
                file.close()
            with open('d:\\練習系統\\練習二2.3.pickle','wb') as file:
                pickle.dump(lst3,file)
                file.close()

以上就是關于“基于Python怎么編寫一個刷題練習系統”這篇文章的內容,相信大家都有了一定的了解,希望小編分享的內容對大家有幫助,若想了解更多相關的知識內容,請關注億速云行業資訊頻道。

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

临泉县| 惠水县| 城固县| 井陉县| 南投市| 兴海县| 商城县| 淮南市| 南涧| 汕头市| 宁德市| 额济纳旗| 沾益县| 阿巴嘎旗| 潮安县| 玉树县| 沧州市| 株洲县| 黄平县| 怀柔区| 辽阳县| 巨鹿县| 繁昌县| 万安县| 怀化市| 光山县| 南昌县| 嫩江县| 盖州市| 牟定县| 崇州市| 洪江市| 磐安县| 陵水| 衡东县| 固阳县| 兴义市| 福鼎市| 宽城| 井冈山市| 射洪县|