Skip to content

Instantly share code, notes, and snippets.

@shalithasuranga
Created June 2, 2022 21:33
Show Gist options
  • Save shalithasuranga/74d71bc8e4d1bb8f1df150bc20e4a862 to your computer and use it in GitHub Desktop.
Save shalithasuranga/74d71bc8e4d1bb8f1df150bc20e4a862 to your computer and use it in GitHub Desktop.
def get_short_name(full_name):
names = full_name.split(' ')
short_name = ''
for i in range(len(names)):
if i < len(names) - 1:
short_name += names[i][0] + '. '
else:
short_name += names[i]
return short_name;
print(get_short_name(input()))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment