Skip to content

Instantly share code, notes, and snippets.

@IKKO-Ohta
Created July 13, 2017 04:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IKKO-Ohta/6fefb790c8c4a084504cda3702dcbdc0 to your computer and use it in GitHub Desktop.
Save IKKO-Ohta/6fefb790c8c4a084504cda3702dcbdc0 to your computer and use it in GitHub Desktop.
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