Digit Conversion Function

Write a function conv_dig(test, conv) that returns a digit conversion
function. The returned function takes a positive integer n and returns a
new integer where each digit d of n that passes the test
(test(d) =  = True) is replaced by its conversion conv(d). Digits of n
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_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
