Added Homework 04 - Strings
This commit is contained in:
parent
aad4e226c5
commit
be356ccb59
24 changed files with 315 additions and 0 deletions
17
homework/homework04/strings/stringToCharacters01.py
Normal file
17
homework/homework04/strings/stringToCharacters01.py
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
|
||||
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}")
|
||||
Loading…
Add table
Add a link
Reference in a new issue