Repository navigation
Expand file tree
/
Copy pathEVM.py
More file actions
129 lines (112 loc) · 2.99 KB
/
Copy pathEVM.py
File metadata and controls
129 lines (112 loc) · 2.99 KB
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
A=0
B=0
C=0
D=0
E=0
NOTA=0
def nomination_detail():
print("Applicants who filed Nominations \n")
print('''1.Nominee A
2.Nominee B
3.Nominee C
4.Nominee D
5.Nominee E
6.NOTA\n''')
print("")
def voting():
global A,B,C,D,E,NOTA
print('''1.Nominee A
2.Nominee B
3.Nominee C
4.Nominee D
5.Nominee E
6.NOTA\n''')
vote=input("Enter Your Vote:")
if vote=="1" :
A+=1
elif vote=="2":
B+=1
elif vote=="3":
C+=1
elif vote=="4":
D+=1
elif vote=="5":
E+=1
elif vote=="6":
NOTA+=1
else:
print("Invalid Vote")
print("")
def result():
if A==0 and B==0 and C==0 and D==0 and E==0 and NOTA==0:
print("No Voting is Done Yet")
else:
if A>B and A>C and A>D and A>E and A>NOTA:
print(f"Nominee A wins the election with {A} Vote")
elif B>A and B>C and B>D and B>E and B>NOTA:
print(f"Nominee B wins the election with {B} Vote")
elif C>A and C>B and C>D and C>E and C>NOTA:
print(f"Nominee C wins the election with {C} Vote")
elif D>A and D>B and D>C and D>E and D>NOTA:
print(f"Nominee D wins the election with {D} Vote")
elif E>A and E>B and E>C and E>D and E>NOTA:
print(f"Nominee E wins the election with {E} Vote")
elif NOTA>A and NOTA>B and NOTA>C and NOTA>D and NOTA>E:
print(f"NOTA wins the election wiwith {NOTA} Vote")
else:
print("Election is Tied")
print("A Re-Election is Required")
print("")
def vote_score():
total = A + B + C + D + E + NOTA
print("Vote Count\n")
print(f"Total Vote in the Region:{total}")
print("")
print(f"A = {A}")
print(f"B = {B}")
print(f"C = {C}")
print(f"D = {D}")
print(f"E = {E}")
print(f"NOTA = {NOTA}")
print("")
def reset_EVM():
global A,B,C,D,E,NOTA
print("\n=========Deleting all the data in the EVM=========")
A=0
B=0
C=0
D=0
E=0
NOTA=0
print("========= EVM Reset Successfully =========")
print("")
while True:
print("Select the Operation\n")
print('''1.Nomination Detail
2.Voting
3.Result
4.Vote Score
5.EVM Reset
6.Exit''')
print("")
n=input("Enter the Choice:")
print("")
if n=="1":
nomination_detail()
elif n=="2":
voting()
elif n=="3":
result()
elif n=="4":
vote_score()
elif n=="5":
confirm = input("Are you sure you want to reset the EVM? (Y/N): ")
if confirm.lower() == "y":
reset_EVM()
else:
print("EVM reset is Cancelled \n")
elif n=="6":
print("Thanks for Voting with Electronic Voting Machine(EVM)")
break
else:
print("Invalid Input")