Skip to content

Instantly share code, notes, and snippets.

@codeboy101
Last active January 12, 2016 17:11
Show Gist options
  • Select an option

  • Save codeboy101/52aa58ccb7e1370c19e4 to your computer and use it in GitHub Desktop.

Select an option

Save codeboy101/52aa58ccb7e1370c19e4 to your computer and use it in GitHub Desktop.
manager_name = input('enter name you would like to play as : ')
print('hi ' + manager_name + ' , you have $120 million dollars to start with and build your very own dream team . you can buy 11 players.listed player prices are in million ')
my_budget = 120
players = {'hart' : 20 ,'curtois' : 18 ,'navas' : 20 ,'bravo' : 15,'cech' : 15 ,'de gea' : 20 , 'ramos' : 40 , 'pique' : 30 , 'ronaldo' : 50 , 'messi' : 50 , 'suarez' : 45 , 'neymar' : 48 , 'bale' : 45 , 'hazard' : 42 , 'aguero' : 40 , 'smith' : 2 , 'johhny' : 4 , 'sunny' : 8 , 'patrick' : 5 , 'debian' : 3 , 'shaggy' : 4.5 , 'randy' : 3 , 'karim' : 6 }
my_team = []
for i in players :
print("Name : " + i + " Value " + str(players[i]) + "Million Dollars")
counter = 1
while counter < 12 :
buy_player = input('name player to buy : ')
if buy_player in my_team :
print(buy_player + " is already in your team")
counter = counter
my_budget = my_budget
elif buy_player not in my_team :
if buy_player in players :
print('Player : ' + buy_player + ' Value : ' + str(players[buy_player]) + " Million Dollars ; " + manager_name + "'s Budget : " + str(my_budget) + " Million Dollars")
ask_final = input('are you sure you want to make this purchase ? (yes or no) , this cannot be reversed; ')
if ask_final.lower() == "yes" :
my_budget = my_budget - players[buy_player]
if my_budget > 0 :
my_team.append(buy_player)
print("Your budget is " + str(my_budget) + " Million Dollars")
counter += 1
elif my_budget == 0 or my_budget < 0 :
print('insufficient funds. purchase cancelled')
counter = counter
my_budget = my_budget
else :
print('purchase cancelled')
my_budget = my_budget
counter = counter
elif buy_player not in players :
print('that player is not available for transfer . check the transfer list again')
print(" : ".join(my_team) )
print('This is your final team.May you achieve victory and glory with them!')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment