Advertisement
Guest User

Quiz #1 The Dev Python

a guest
Jun 15th, 2019
2,012
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.08 KB | None | 0 0
  1. import random
  2. from tkinter import *
  3.  
  4. window = Tk()
  5. window.title("Quiz")
  6. window.geometry("600x450")
  7.  
  8. questions = [["Was ist die für den Körper gefährlichste Droge?","LSD","Cannabis","Pilze","Alkohol"]]
  9. questions.append(["Was ist die beste Programmiersprache?","Javascript","C","Delphi","Python"])
  10. questions.append(["Wie kalt ist flüssiger Stickstoff?","-87°C","-236°C","-346°C","-196°C"])
  11. questions.append(["Aus was besteht Licht nicht?","Wellen","Energie","Teilchen","Strom"])
  12. questions.append(["Wer erfand Python?","Albert Einstein","Steve Jobs","James Gosling","Guido van Rossum"])
  13. questions.append(["Wie warm ist die Sonne im Kern?","15000°C","1600°C","200000000°C","15000000°C"])
  14.  
  15. def clear():
  16.     list = window.grid_slaves()
  17.     for n in list:
  18.         n.destroy()
  19.  
  20. class Menu:
  21.     def __init__(self):
  22.         clear()
  23.         self.Quiz = Button(window, text="Quiz", font=("Arial", 14), command=quizCreator, width=15, height=3)
  24.         self.Quiz.grid(column=0,row=0,padx=218,pady=170)
  25.  
  26. def menuCreator():
  27.     m = Menu()
  28.  
  29. def quizCreator():
  30.     q = Quiz(questions)
  31.  
  32. menuCreator()
  33. window.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement