Created
July 17, 2019 06:12
-
-
Save jatinsharrma/ff3733a7ee2ee5e9f51684c59e4290fc to your computer and use it in GitHub Desktop.
Count a tell who wins
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
#count who wins | |
#This method accepts the name of winner of each match of the day | |
def find_winner_of_the_day(*match_tuple): | |
count_A = match_tuple.count("Team1") | |
count_B = match_tuple.count("Team2") | |
if count_A>count_B: | |
return("Team1") | |
elif count_A < count_B: | |
return ("Team2") | |
else: | |
return ("Tie") | |
#Invoke the function with each of the print statements given below | |
print(find_winner_of_the_day("Team1","Team2","Team2","Team1","Team2")) | |
#print(find_winner_of_the_day("Team1","Team2","Team1","Team2")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment