week-2 #2

Merged
Kenwood merged 7 commits from week-2 into master 2021-02-02 20:57:11 -05:00
1 changed files with 20 additions and 0 deletions
Showing only changes of commit 9b128a8a96 - Show all commits

View File

@ -0,0 +1,20 @@
def output_format_one(first, middle, last):
_format = "{0}, {1}.".format(last, first[0])
return _format
def output_format_two(first, middle, last):
_format = "{0}, {1}.{2}.".format(last, first[0], middle[0])
return _format
if __name__ == '__main__':
name = input("Input your name: ")
name = name.split(' ')
if len(name) == 2:
name = output_format_one(name[0], None, name[1])
elif len(name) == 3:
name = output_format_two(name[0], name[1], name[2])
print(name)