create a list that contains double alphabet in python

Here is an example of how to create a list that contains double alphabets in python:

main.py
double_alphabet_list = []
alphabet = "abcdefghijklmnopqrstuvwxyz"

for letter in alphabet:
    double_letter = letter * 2
    double_alphabet_list.append(double_letter)

print(double_alphabet_list)
198 chars
9 lines

This code creates an empty list called double_alphabet_list and iterates over each letter in the alphabet. It then creates a new string called double_letter which is simply the original letter repeated twice. This new string is then appended to the double_alphabet_list. Finally, the code prints the complete list of double letters.

gistlibby LogSnag