input: Write a python function to replace all digits in a string with a given number.
  assert replace_digit("hello123", 5) == "hello555"
  assert replace_digit("abc987xyz", 0) == "abc000xyz"
  assert replace_digit("test123test", 9) == "test999test"
output: def replace_digit(s: str, num: int) -> str:
      return ''.join(str(num) if char.isdigit() else char for char in s)