I'm trying to write a text file that has a list of rearranged alphabets so that each begins with a different character. The first letter is moved to the end, repeat.
alphabet = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'] # generate 26 alpabets without typing all def alpha_gen(alphabet,a_list): x = 0 while x < 26: alphabet += [alphabet.pop(0)] key = alphabet(0) written = str(key) + ' : ' + str(alphabet) + '\n' a_list.write(written) x += 1 def main(): a_list = open('alpabet_list.txt', 'w') alpha_gen(alphabet, a_list) a_list.close() if __name__ == '__main__': main()
But I get this error:
File "vigenere_cipher.py", line 13, in alpha_gen key = alphabet(0) TypeError: 'list' object is not callable