Stefan
Legend
I shouldn't have looked... now my hate for unpythonic Python kicked in
. I'll leave it at this bit, though.
Code:
def createTable():
letters = "ABCDEFGHIJKLMNOPQRSTUVWX"
letterList = [[first + second]
for first in letters for second in letters
if first != second]
writeFile(letterList)
return letterList
def writeFile(letterList):
with open("letterList.txt", "w") as file:
for line in letterList:
print(", ".join(line), file=file)
Last edited: