Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from random import shuffle
- #shuffle function randomises the order of the whole list
- players = ['A','B','C','D','F','E','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
- teamA2 = []
- teamB2 = []
- shuffle(players)
- if len(players) < 4 :
- print("Error, the minimum required for the game is upper or equal to 4.")
- elif len(players) == 0 :
- print("Error, the minimum required for the game is upper or equal to 4.")
- else :
- while players != [] :
- teamA2.append(players[-1])
- players.pop(-1)
- teamB2.append(players[-1])
- players.pop(-1)
- print(teamA2)
- print(teamB2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement