Complete the code to convert the character 'A' to its ASCII number.
ascii_value = ord([1])The ord() function takes a single character as a string and returns its ASCII (or Unicode) number. The character must be in quotes.
Complete the code to convert the ASCII number 66 back to its character.
char = chr([1])The chr() function takes an integer ASCII (or Unicode) code and returns the corresponding character. The input must be an integer, not a string.
Fix the error in the code that tries to get the ASCII code of the string 'Hello'.
code = ord([1])The ord() function only works with a single character. To get the ASCII code of the first letter in 'Hello', pass just 'H' in quotes.
Fill both blanks to create a dictionary mapping each character in 'abc' to its ASCII code.
ascii_map = { [1] for [2] in 'abc' }This dictionary comprehension loops over each character in the string 'abc' and maps it to its ASCII code using ord().
Fill all three blanks to create a dictionary of characters and their Unicode codes for 'ñöç'.
unicode_map = { [1]: [2] for [3] in 'ñöç' }ord() correctly.This dictionary comprehension uses the variable ch to loop over each character in the string 'ñöç' and maps each character to its Unicode code using ord().