To obtain a string from the user, you can use the input() function like this:
name = input("Enter a name: ")
Then you can use the string's format() function to insert the value:
print("Hello, {}!".format(name))
The format() function expects one parameter for every {} in the string and it will substitute the {} for the value of the parameter in the order they are provided.