eolymp
bolt
Try our new interface for solving problems
Problems

Replace digit

published at 4/29/24, 3:16:34 pm

def replace_digit(n, a, b):

n_str = str(n)

new_n_str = n_str.replace(str(a), str(b))

new_n = int(new_n_str)
return new_n

n, a, b = map(int, input().split())

print(replace_digit(n, a, b))