2026fa_cse160/homework/homework04/strings/stringToCharacters01.py

17 lines
No EOL
359 B
Python

import string
message = '''
This program prints the Ascii codes for all the letters.
Notice the lower case letters are represented by larger
integers than the upper case letters.
'''
print(message)
# Load the string variable
stringOfLetters = string.ascii_letters
for myCharacter in stringOfLetters:
print(f"{myCharacter:2s}{ord(myCharacter):3d}")