Thanks so much everyone who helped!
So basically I need to parse a name and find the following info:
First Name
First Initial (if employee has initials for a first name like D.J., use both initials)
Last Name (include if employee has a suffix such as Jr. or III.)
So here's the interface I'm working with:
Input:
names = ["D.J. Richies III", "John Doe", "A.J. Hardie Jr."]
for name in names:
print parse_name(name)
Expected Output:
{'FirstName': 'D.J.', 'FirstInitial': 'D.J.', 'LastName': 'Richies III' }
{'FirstName': 'John', 'FirstInitial': 'J.', 'LastName': 'Doe' }
{'FirstName': 'A.J.', 'FirstInitial': 'A.J.', 'LastName': 'Hardie Jr.' }
Not really good at Regex, and actually that's probably overkill for this. I'm just guessing:
if name[1] == ".": # we have a name like D.J.?
Eh, I don't know, haven't been working with Python very long.
Any help would be GREATLY appreciated! Thanks :)