VintageRice

[College] - Random Team vs.

Apr 21st, 2015
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.60 KB | None | 0 0
  1. #   Date Created: 21/04/2015
  2. #   Author: Kyle Minto
  3. #   Random Teams
  4.  
  5. import random;
  6.  
  7. print("********************");
  8. print("Random Team Selector");
  9. print("********************\n");
  10.  
  11. teamCount = input("Enter a number of teams: ");
  12. teamNames = [];
  13.  
  14. print("\n");
  15.  
  16. for i in range(0, teamCount):
  17.     a = raw_input("Enter team name for team #" + str(i + 1) + ": ");
  18.     teamNames.insert(i, a);
  19.    
  20. print("\n");
  21.  
  22. for i in range(0, (teamCount / 2)):
  23.     a = random.choice(teamNames);
  24.     teamNames.remove(a);
  25.  
  26.     b = random.choice(teamNames);
  27.     teamNames.remove(b);
  28.  
  29.     print(a + " v " + b);
Advertisement
Add Comment
Please, Sign In to add comment