Answer:
Written in Python:
import re
name = input("Name: ")
print(re.sub("[ ]", ", ", name))
Step-by-step explanation:
This line imports the regular expression library
import re
This line prompts user for input
name = input("Name: ")
This line replace the space with comma and prints the output
print(re.sub("[ ]", ", ", name))