forked from makhauser/python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshufflePO.py
More file actions
26 lines (26 loc) · 974 Bytes
/
shufflePO.py
File metadata and controls
26 lines (26 loc) · 974 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/local/bin/python3
import random
import os
potA = []; potB = []
s = 0
l = [potA,potB]
pair_c = input ("How many pairs are there? ")
try: pair_c = int(pair_c)
except ValueError: print("Not a digit, please try again"); exit()
while pair_c < 2:
print("Wrong amount of pairs");
pair_c = int(input ("How many pairs are there? "))
for item in l:
s += 1
for i in range (1, pair_c+1):
inp = input ("Please input %i team for the %i pot: " % (i,s))
while inp=="": print("Blank input, try again"); inp = input ("Please input %i team for the %i pot: " % (i,s))
if inp != '': item.append(inp)
random.shuffle (potA); random.shuffle (potB)
while potB:
for counter in range (1, pair_c+1):
pop_a = potA.pop(); random.shuffle (potA)
pop_b = potB.pop(); random.shuffle (potB)
print("Pair",str(counter)+ ":", str(pop_a),"-",str(pop_b)) # print("Pair", str(counter)
print("")
input("Press <Enter> to exit the app\n")