Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
import itertools
N = int(input())
A = ["a","b","c"]
co = [i for i in itertools.product(A, repeat=N)]
for x in co:
print("".join(list(x)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment