I am doing some practice code exercises, and the question is asking to "Provide a script printing every possible pairs of two letters, only lower case, one by line, ordered alphabetically." Basically you should print out
aa
ab
a
..
ba
bb
..
zz
I've got the two loops going fine, but I can't remove the white space between the returned valued. So I am printing out
a a
rather than
aa
Here is my code
import string
x=string.ascii_lowercase
for i in x:
for j in x:
print(i, j).strip()
This question has been answered elsewhere, but I don't understand any of the answers. Thanks.