I am new to python and did not see this exact questions or answers that will work. I am using Python 3.7 and simply need to display the character codes for uppercase alphabet letters (A-Z). I have that part, but it also requires the output be printed so each letter and character code appear on a separate line divided into two columns with a label.
My code works great but prints horizontally (which I prefer, but the instructions are to print vertically with a header).
def uppercaseAlphabets():
# uppercase
for c in range(65, 91):
print(chr(c), end=" ");
print("");
# Function to print the alphabet upper case codes
def uppercaseCodes():
for c in range(65, 91):
print((c), end=" ");
print("");
print("Uppercase Alphabets");
uppercaseAlphabets();
print("Uppercase Codes ");
uppercaseCodes();
The result is:
Uppercase 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
Uppercase Codes
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
I want it to look like this:
Uppercase Alphabet Uppercase Codes
A 65
B 66
C 67
and so on. Any tweeks to my code are appreaciated. Thanks