Question: Write a Python function called code_char(c, key) that takes a letter and a digit as input, and returns the letter shifted key positions to the
Write a Python function called code_char(c, key) that takes a letter and a digit as input, and returns the letter shifted key positions to the right in the alphabet. The function should work with standard letters (uppercase or lowercases). You can assume that parameter c is always a letter from the alphabet.
Example: >>> code_char(a, 2)
c >>>
code_char(U, 6)
A
You may need to use the following Python built-in function:
chr that given an ASCII code returns the corresponding character
>>> chr(90)
'Z'
ord given a character returns its ASCII code
>>> ord('j')
106
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
