I've been struggling in creating the vigenere table in python That should be the result:
So basically I have the entire alphabet on the first line, and the alphabet shifted by one letter on the second one etc.
That's my code so far:
class CypherTable:
def __init__(self):
self.matrix = [[chr(i) for i in range(ord('a'),ord('z')+1)] for i in range(5)]
def __str__(self):
for i in range(len(self.matrix)):
print self.matrix[i]
return ""
table = CypherTable()
print(table)
I managed to print letters from a to z a number of times but I don't know how to modify each interaction in order to shift the first letter by one. I'm used to work in java where you first define the array length and then populate it, but since python has a faster syntax I can't figure out what's the best way to do it.