[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:
cat = "child"
elif 13 < age < 20:
elif age < 20:
cat = "teenager"
else:
cat = "grown-up"

View File

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