Created
February 22, 2015 12:32
-
-
Save anonymous/4ba22acea589404b7162 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
vote = [1,1,2,2,2,2,2,3] | |
def winner(vote,k): | |
a=0 | |
for i in vote: | |
if i==k: | |
a+=1 | |
if a>(len(vote)/2): | |
return True | |
else: | |
return False | |
print(winner(vote,2)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://gist.github.com/Andygmb/b567ce5efd30524960b7