当前位置: 首页 > news >正文

Python练习系统

用python给自己做个练习系统刷题吧!

#免费源码在文末公众号哈# 

选择题

def xuanze():global flag2if 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 flag2if 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 flag2if 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()
http://www.lryc.cn/news/13160.html

相关文章:

  • Transformer学习笔记1
  • 软件测试简历个人技能和项目经验怎么写?(附项目资料)
  • C语言运算符优先级和结合性一览表
  • Java8介绍
  • Java 基准测试
  • 普通护照出国免签及落地签国家和地区
  • 20230219 质心和重心的区别和性质
  • maven多环境配置
  • 设计模式之中介模式与解释器模式详解和应用
  • 2023年全国最新交安安全员精选真题及答案1
  • chrome插件开发备忘录
  • 实例1:控制树莓派板载LED灯闪烁
  • 华为OD机试题 - 最大排列(JavaScript)
  • 手动创建 vue2 ssr 开发环境
  • RHCE-操作系统刻录工具
  • PHP面向对象01:面向对象基础
  • 《爆肝整理》保姆级系列教程python接口自动化(十八)--重定向(Location)(详解)
  • MySQL的索引、视图
  • 【JavaWeb】网络层协议——IP协议
  • 【Python学习笔记】41.Python3 多线程
  • Windows 版本ffmpeg编译概述
  • NETCore下CI/CD之自动化测试 (详解篇)
  • Hoeffding不等式剪枝方法
  • 【算法】数组中的重复数字问题
  • 数值方法笔记2:解决非线性方程
  • 基于SpringBoot的在线文档管理系统
  • 软件体系结构(期末复习)
  • [vue3] pinia的基本使用
  • 进程和线程详解
  • 《刀锋》读书笔记