I am trying to create a three letter combination. For example if I enter 'b' as my letter, I would start with the first alphabet 'a' and it will loop until all three combination is equal to 'b' aaa aab aba abb baa bab bba bbb
My output is incomplete because it is skipping some of the letter combination like "aab" and "bab".
import string
letter = input("Enter letter: ") # from a to letter
for i in range(ord('a'), ord(letter) + 1):
for j in range(ord('a'), ord(letter) + 1):
for k in range(ord('a'), j + 1):
print(chr(i), chr(j), chr(k))
