Click here to Skip to main content
15,886,578 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am not too sure how to get my code to have an output like this:

['aaaaa', 'bbbbb', 'ccccc', 'ddddd', 'eeeee', 'fffff', 'ggggg', 'hhhhh', 'iiiii', 'jjjjj', 'kkkkk', 'lllll', 'mmmmm', 'nnnnn', 'ooooo', 'ppppp', 'qqqqq', 'rrrrr', 'sssss', 'ttttt', 'uuuuu', 'vvvvv', 'wwwww', 'xxxxx', 'yyyyy', 'zzzzz', 'AAAAA', 'BBBBB', 'CCCCC', 'DDDDD', 'EEEEE', 'FFFFF', 'GGGGG', 'HHHHH', 'IIIII', 'JJJJJ', 'KKKKK', 'LLLLL', 'MMMMM', 'NNNNN', 'OOOOO', 'PPPPP', 'QQQQQ', 'RRRRR', 'SSSSS', 'TTTTT', 'UUUUU', 'VVVVV', 'WWWWW', 'XXXXX', 'YYYYY', 'ZZZZZ']

What I have tried:

this is my code:

def upperCaseAlphabets():
for i in range(65, 91):
print(chr(i) * 5, end=" ")
print()

def lowerCaseAlphabets():
for i in range(97, 123):
print(chr(i) * 5, end=" ")

lowerCaseAlphabets();
upperCaseAlphabets();
Posted
Updated 16-Sep-21 6:13am
Comments
OriginalGriff 16-Sep-21 12:11pm    
And?
What have you tried?
Where are you stuck?
What help do you need?

Use the "Improve question" widget to edit your question and provide better information.
Sagar Bulsara 16-Sep-21 12:13pm    
I have tried adding "" in the print(chr(i) * 5, end=" ") but that just outputs chr(i) 5 times

1 solution

Python
source = 'abcdefghijklmnopqrstuvwxyz'
alphabet = []
for letter in source:
    alphabet.append(letter * 5)
for letter in source.upper():
    alphabet.append(letter * 5)
print(alphabet)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900