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

14 lines
283 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
if __name__ == "__main__":
main()