(Jul-18-2017, 09:35 AM)lukorir Wrote: Dear all, I would like to learn Python by working on a project. The project is to write Python code that can print out a list of all possible football outcome combinations for 8 matches, where each match has 3 possible outcomes (1=home team win, 2=away team win, X=draw). How can I go about this?
Here is the code
# Input this part then enter number of matches
import random
n=int(input("Enter number of games: "))
# After entering number of matches, write the following:
p=3**n
for x in range(p):
print( ''.join(random.choice('1X2') for _ in range(n)))
# Someone can add to this code part for removal of duplicates