-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_vote.py
30 lines (24 loc) · 992 Bytes
/
get_vote.py
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
from voteInfo import voteInfo
#checks if the vote cast was valid
def valid_vote(vote):
#if vote.casefold() == 'cpe' or vote.casefold() == 'ece':
if vote == 'cpe' or vote == 'ece':
return True
else:
return False
#Gets vote info from cli inputs and returns voteInfo object
def get_vote():
name = input("Enter your name: ")
vote = input("Enter your vote (ECE/CPE): ")
while(valid_vote(vote) == False):
print("You may only vote for 'ece' or 'cpe'")
vote = input("Enter your vote (ECE/CPE): ")
email = input("Enter your email: ")
#confirming input and adding to queue
print("\nname: " + name + " vote: " + vote + " email: " + email)
#confirm = input("Confirm this information is correct and you would like to submit your vote (Y/N)")
#if confirm.casefold() == "Y".casefold():
return voteInfo(vote,name,email)
#else:
# return None
# print("Submission Canceled")