[FP] Quick simplifications

This commit is contained in:
TiagoRG 2023-05-17 10:30:19 +01:00
parent f9bb9f1450
commit ca711863a7
2 changed files with 2 additions and 6 deletions

View File

@ -16,7 +16,7 @@ print("Age:", age)
if age < 13: if age < 13:
cat = "child" cat = "child"
elif 13 < age < 20: elif age < 20:
cat = "teenager" cat = "teenager"
else: else:
cat = "grown-up" cat = "grown-up"

View File

@ -4,11 +4,7 @@ def main():
def shorten(string): def shorten(string):
abv = '' return ''.join([char for char in string if char.isupper()])
for char in string:
if char.isupper():
abv += char
return abv
if __name__ == "__main__": if __name__ == "__main__":