Skip to content

Instantly share code, notes, and snippets.

@wakoliVotes
Last active February 19, 2022 00:11
Show Gist options
  • Save wakoliVotes/5b58477e2fd8fd7e168a70ccde382e53 to your computer and use it in GitHub Desktop.
Save wakoliVotes/5b58477e2fd8fd7e168a70ccde382e53 to your computer and use it in GitHub Desktop.
Python is Used in this case to Calculate a Team's based on Wins, Draws and Losses. This functions works by taking wins, draws and losses and computing a teams total points
# This functions works by taking wins, draws and losses and computing a teams total points
# In this scenario, a win = 3 points, a draw = 1 point and a loss = 0 points
onesTeamName = input("Enter the Name of your name : ")
wonMatches = input("Kindly enter the number of matches your team won : ")
if float(wonMatches) >= 40:
print("Error, please enter a valid number")
drawMatches = input("Kindly enter the number of matches your team draw : ")
if float(drawMatches) >= 40:
print("Error, please enter a valid number")
lossMatches = input("Kindly enter the number of matches your team lost : ")
if float(lossMatches) >= 40:
print("Error, please enter a valid number")
if float(wonMatches + drawMatches + lossMatches) >= 40:
print("You entered too many items or wrong values for your team.")
teamPoints = float(wonMatches)* 3 + float(drawMatches)*1 + float(lossMatches)*0
print("The Total Points for " + onesTeamName + " this 2021 Season is :: ", teamPoints)
if teamPoints >= 100:
print("You have Broken the record and are the champions.")
elif teamPoints >= 80:
print("Your Team is in the 2nd Place")
elif teamPoints >= 60:
print("Your team " + onesTeamName +" is in the 3rd Place.")
else:
print("Its Amazing for the journey, however, Your " + onesTeamName +" is NOT in the TOP 4 this year.")
@wakoliVotes
Copy link
Author

Here is a sample run time screen, with Manchester United Illustration
Sample Runtime Screen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment