Printing every possible pairs of two different letters no double pairs HACKINSCIENCE

I found a great site hackinscience org, with 70 python problems to work through.

problem 17, requires returning the possible two letter pairs without doubles such as aa, bb. from a - z.

this script does this however, I keep getting an error message that states, what about b a? the script returns b a!!

import string
x=string.ascii_lowercase
y=list(x)
for i in y:
for g in y:
if i != g:
print(i,g)

Hi Josh!

I just enhanced the error message, you should now see:

You printed 'a b' instead of 'ab'.

which should help you fixing your code :slight_smile:
Hope it helps!

Hi there!
at the end should be print(i + g) instead of print(i,g)
print(i,g) ==> a b
print(i+g) ==> ab