Python Forum

Full Version: Simple code help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello everyone, I need some help with what should be a rather simple code:

fname = input("What is your first name?")
sname = input("What is your surname?")
fullname = (fname)+(sname)
print("My name is {}".format(fullname))

When I input the name and surname, the result comes out connected, like this:

JeffJefferson

How do I split the name the result, so that it comes out like this?:

Jeff Jefferson
Welcome!

Just use two placeholders

print('My name is {} {}'.format(fname, sname))