uaveiro-leci/1ano/1semestre/fp/aula05/shorten.py

16 lines
273 B
Python
Raw Normal View History

2022-10-20 21:22:14 +00:00
def main():
print(shorten("Universidade de Aveiro"))
print(shorten("United Nations Organization"))
2022-11-10 23:20:38 +00:00
2022-10-20 21:22:14 +00:00
def shorten(string):
abv = ''
for char in string:
2022-11-10 23:20:38 +00:00
if char.isupper():
2022-10-20 21:22:14 +00:00
abv += char
return abv
2022-10-20 21:22:14 +00:00
if __name__ == "__main__":
main()