Using the Unicode Standard code values, create a Python dictionary with the letters of the English alphabet as keys and their Unicode equivalents as values. Create a program that displays each letter with its Unicode representation. The output should include both uppercase and lowercase letters.

What will be an ideal response?


```
# Creates a dictionary of the English alphabet

# display each letter and its hexadecimal value
def displayAlphabet( alphabet ):

keys = alphabet.keys()
keys.sort()

for key in keys:
print key, "=", alphabet[ key ] + "\t",

alphabet = {}

# 0x0041 = 'A' = 65 (decimal)
for i in range( 65, 91 ):

# key is letter
# value is hexadecimal value
alphabet[ chr( i ) ] = str( hex( i ) ).replace( "0x", "\u00" )

for i in range( 97, 123 ):
alphabet[ chr( i ) ] = str( hex( i ) ).replace( "0x", "\u00" )

displayAlphabet( alphabet )
```
A = \u0041 B = \u0042 C = \u0043 D = \u0044
E = \u0045 F = \u0046 G = \u0047 H = \u0048
I = \u0049 J = \u004a K = \u004b L = \u004c
M = \u004d N = \u004e O = \u004f P = \u0050
Q = \u0051 R = \u0052 S = \u0053 T = \u0054
U = \u0055 V = \u0056 W = \u0057 X = \u0058
Y = \u0059 Z = \u005a a = \u0061 b = \u0062
c = \u0063 d = \u0064 e = \u0065 f = \u0066
g = \u0067 h = \u0068 i = \u0069 j = \u006a
k = \u006b l = \u006c m = \u006d n = \u006e
o = \u006f p = \u0070 q = \u0071 r = \u0072
s = \u0073 t = \u0074 u = \u0075 v = \u0076
w = \u0077 x = \u0078 y = \u0079 z = \u007a

Computer Science & Information Technology

You might also like to view...

Identification of compliance requirements is done during which of the following phases of the SDLC?

A) Initiation B) Development/acquisition C) Implementation/assessment D) Operations/maintenance

Computer Science & Information Technology

Create a JavaFX application with two buttons and two labels. Add an Image Icon of your choice to the first button and the first label.

This project uses a VBox layout and the same image used in the text chapter. A different image could be used for either the button or the label.

Computer Science & Information Technology

When cropping a picture, the Crop button can be found in the ________ group

A) Size B) Arrange C) Styles D) Adjust

Computer Science & Information Technology

List six operators that can be used with the compare instruction.

What will be an ideal response?

Computer Science & Information Technology