I'm new to programming, just going through a wee online course, but I've hit a stumbling block on one of the tasks.
The task is to print the coordinates in the format of an 8 by 8 grid. So A1 to H1 is on the first line, A2 to H2 on the second, etc. The task is to be done using nested list comprehension where possible.
So far I have this, which puts all coordinates on the same line separated by a space:
let=["A","B","C","D","E","F","G","H"]
num=[1,2,3,4,5,6,7,8]
[print(i,j,sep="",end=" ") for j in num for i in let]
I've tried some daft things that definitely do not work, such as:
let=["A","B","C","D","E","F","G","H"]
num=[1,2,3,4,5,6,7,8]
[print(i,j,sep="",end=" " if i!=H) for j in num for i in let]
Is there a way to do this in a single line without typing out full "for" loops?