Homework2

This commit is contained in:
2023-05-26 15:14:12 -05:00
parent 291ba82046
commit 081471fa5d
+9 -1
View File
@@ -19,4 +19,12 @@ print("Size of bytes:", bytes_size)
# Emojis are represented using Unicode characters, which require more
# bytes to store compared to ASCII characters. Therefore, if you have
# a string that contains emojis, its size will be larger than a string
# without emojis.
# without emojis.
def print_string_as_numbers(input_string):
for char in input_string:
print(ord(char), end=' ')
# Example usage
input_string = "Hello, World!"
print_string_as_numbers(input_string)