Digit Conversion Function

Write a function conv_dig(test,conv)conv\_dig(test, conv) that returns a digit conversion function. The returned function takes a positive integer nn and returns a new integer where each digit dd of nn that passes the test (test(d)==Truetest(d) == True) is replaced by its conversion conv(d)conv(d). Digits of nn that do not pass the test are to be left unchanged by the digit conversion function.

Input

Output

Observation

Let us insist that the digit conversion function described is not the required conv_digconv\_dig proper, but its output.

Problem information

Author: Jordi Delgado and José Luis Balcázar

Generation: 2026-01-25T14:48:27.845Z

© Jutge.org, 2006–2026.
https://jutge.org