Python Forum
Please Help - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Please Help (/thread-23964.html)



Please Help - jackthechampion - Jan-25-2020

So im in introduction to programming and we use python and the assignment is
Create a program that prompts the user to enter a first name and a last name separately. The program then concatenates the names (using +) and displays the full name using Title capitalization, even if the names were entered in lower case.

my issue is i'm not able to capitalize both the first and last name when it's entered and get a space at the same time as i'm using a + to connect first_name and last_name commands please help me solve this so I can learn because everything i've tried hasn't worked.


RE: Please Help - michael1789 - Jan-25-2020

I'm sure it's not the best practice, but in the past I've added spaces by putting in a string that just contains a space.

You say you have to use title() So you just have to make a string that is the first and second names, and apply the title method.

full_name_string = str(first_name + " " + second_name)
print(full_name_string.title())
It works at least lol


RE: Please Help - buran - Jan-25-2020

Use .title() on both user inputs, before concatenating.