-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlevel-2
105 lines (84 loc) · 4.25 KB
/
level-2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
import tkinter as tk
import random
from tkinter import *
from tkinter import messagebox
finStatements = ["Balance Sheet", "Income Statement", "Statement of Cash Flows", "Asset", "Liability"]
definitions = ["A(n) ______ is a financial statement that reports a company's assets, liabilities and shareholders' equity at a specific point in time, and provides a basis for computing rates of return and evaluating its capital structure.", "A(n) _____ is one of the three (along with balance sheet and statement of cash flows) major financial statements that reports a company's financial performance over a specific accounting period.", "A(n) _____ is a financial statement that provides aggregate data regarding all cash inflows a company receives from its ongoing operations and external investment sources.", "A(n) _____ is a resource with economic value that an individual, corporation, or country owns or controls with the expectation that it will provide a future benefit.","A(n) _____ is something a person or company owes, usually a sum of money."]
answerKey = definitions[::-1]
random.shuffle(answerKey)
variables = {}
top = Tk()
top.geometry("100x100")
counters = [0]
def BS():
if counters[0] == 5:
messagebox.showinfo(finStatements[0], "You've completed level 2! Please press the 'STOP' button and proceed to the next level.")
elif definitions[0] == answerKey[counters[0]]:
messagebox.showinfo(finStatements[0], "Correct!")
counters[0] = int(counters[0]+1)
else:
messagebox.showinfo(finStatements[0], "False, please try again!")
def IS():
if counters[0] == 5:
messagebox.showinfo(finStatements[0], "You've completed level 2! Please press the 'STOP' button and proceed to the next level.")
elif definitions[1] == answerKey[counters[0]]:
messagebox.showinfo(finStatements[0], "Correct!")
counters[0] = int(counters[0]+1)
else:
messagebox.showinfo(finStatements[0], "False, please try again!")
def SCF():
if counters[0] == 5:
messagebox.showinfo(finStatements[0], "You've completed level 2! Please press the 'STOP' button and proceed to the next level.")
elif definitions[2] == answerKey[counters[0]]:
messagebox.showinfo(finStatements[0], "Correct!")
counters[0] = int(counters[0]+1)
else:
messagebox.showinfo(finStatements[0], "False, please try again!")
def AS():
if counters[0] == 5:
messagebox.showinfo(finStatements[0], "You've completed level 2! Please press the 'STOP' button and proceed to the next level.")
elif definitions[3] == answerKey[counters[0]]:
messagebox.showinfo(finStatements[0], "Correct!")
counters[0] = int(counters[0]+1)
else:
messagebox.showinfo(finStatements[0], "False, please try again!")
def LB():
if counters[0] == 5:
messagebox.showinfo(finStatements[0], "You've completed level 2! Please press the 'STOP' button and proceed to the next level.")
elif definitions[4] == answerKey[counters[0]]:
messagebox.showinfo(finStatements[0], "Correct!")
counters[0] = int(counters[0]+1)
else:
messagebox.showinfo(finStatements[0], "False, please try again!")
def Current():
if counters[0] == 5:
messagebox.showinfo("Current Definition", "You've completed level 2! Please press the 'STOP' button and proceed to the next level.")
else:
messagebox.showinfo("Current Definition", answerKey[counters[0]])
B1 = Button(top, text = finStatements[0], command = BS)
B2 = Button(top, text = finStatements[1], command = IS)
B3 = Button(top, text = finStatements[2], command = SCF)
B4 = Button(top, text = finStatements[3], command = AS)
B5 = Button(top, text = finStatements[4], command = LB)
B6 = Button(top, text = "Show Current Definition", command = Current)
B6.place(x = 35,y = 60)
B1.place(x = 35, y = 90)
B2.place(x = 35, y = 120)
B3.place(x = 35, y = 150)
B4.place(x = 35, y = 180)
B5.place(x = 35, y = 210)
counter = 0
def counter_label(label):
def count():
global counter
counter += 1
label.config(text=str(counter))
label.after(1000, count)
count()
top.title("Counting Seconds")
label = tk.Label(top, fg="green")
label.pack()
counter_label(label)
button = tk.Button(top, text='Stop', width=25, command=top.destroy)
button.pack()
top.mainloop()