Question: Use python to complete the following function. An online banking application uses a 5 number pin code as part of their security checks. Each time

Use python to complete the following function.

An online banking application uses a 5 number pin code as part of their security checks. Each time a customer attempts to log on, they are asked for a different three digits from their PIN. The system keeps track of which three digits were asked for using a 5-character string called a mask. The mask has an 'X' for a digit that has been requested and a dash ('-') otherwise, e.g. '-X-XX' when digits 2, 4 and 5 have been requested. Write a function requested_digits that takes a PIN (as a string of 5 digits) and a mask, and returns a string of 3 digits giving just the requested digits.

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!