Skip to content

Instantly share code, notes, and snippets.

@jatinsharrma
Created July 17, 2019 06:12
Show Gist options
  • Save jatinsharrma/ff3733a7ee2ee5e9f51684c59e4290fc to your computer and use it in GitHub Desktop.
Save jatinsharrma/ff3733a7ee2ee5e9f51684c59e4290fc to your computer and use it in GitHub Desktop.
Count a tell who wins
#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