This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_can_option(): | |
#RACE CLOSE | |
print ("Who will you vote for if the race is close?") | |
can1 = input("CANDIDATE = ") | |
#RACE NOT CLOSE | |
print ("Who will you vote for if the race is not close?") | |
can2 = input("CANDIDATE = ") | |
#loop through all the options we want, if for the first elif for the middle, else for the last |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
words, num = open('enable1.txt', 'r').readlines(), 0 | |
for word in words: | |
aword = word[:-2] | |
if ''.join(sorted(aword)) == aword: | |
num += 1 | |
print num |