1
1
mirror of https://github.com/theoludwig/programming-challenges.git synced 2024-10-29 22:17:23 +01:00

feat(solutions): add acronyms/python/function

This commit is contained in:
Divlo 2021-06-30 12:51:53 +02:00
parent 2b0ff4b877
commit eafb394187
No known key found for this signature in database
GPG Key ID: 185ED2F15F104E52
2 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,3 @@
# acronyms/python/function
Created by [@Divlo](https://github.com/Divlo) on 30 June 2021.

View File

@ -0,0 +1,17 @@
from typing import List
import sys
input_values: List[str] = []
for value in sys.stdin:
input_values.append(value.rstrip('\n'))
def get_acronym(sentence: str) -> str:
words = sentence.replace('"', '').split(' ')
acronym = ''
for word in words:
acronym += word[0].capitalize()
return acronym
print(get_acronym(input_values[0]))