<human>:  Python functions to variable replacement in string.
<bot>: Here is a Python function to replace variable replacement in string

import string

def replace_var(string, old, new):
  """
  Replace all occurrences of old with new in string.

  >>> replace_var("Hello, world!", "o", "O")
  'Hello, WORLD!'
  """
  return string.replace(old, new)

# Enter the string
string = "Hello, world!"

# Enter the old and new strings
old = "o"
new = "O"

# Calling the function
print((replace_var(string, old, new)))

#Example Output
# HellO, wOrld!

#Remember to inspect code for bugs.