Your goal in this lab is to create a program that will input the user's full name in single entry and then greet them only by their first name.
The program should still deal with any extra spaces and continue to capitalize names. Try to chain your functions and use f-strings as well.
Here is how it should work:
Open GitHub Desktop and the Mad Libs repository
Open the repository in VS Code (or Codespaces)
Open lab4.py
The split() method breaks a single string into smaller parts, separated by spaces, and puts those parts into a list. It's particularly useful when you need to separate elements within a single string into distinct parts. For instance, splitting a full name into its constituent first and last names.
In Python, the first item in a list is at position 0, not 1. Think of it like starting to count from zero instead of one. So, when we say items[0], we are asking Python to give us the first item in the list, which is "Milk" in this case.
With the concept learned above, complete the program which asks for their full name
The program should then greet the user with only their first name by splitting it from the full name
When done, test it to ensure it removes any extra whitespace and capitalizes the name
Then, save all of your work and close VS Code
Back in GitHub Desktop, commit with a meaningful comment. E.g. "Finished lab 4"
Push your code