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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!