diff --git a/1ano/1semestre/fp/aula02/age.py b/1ano/1semestre/fp/aula02/age.py index 0b17f82..f43cbfe 100755 --- a/1ano/1semestre/fp/aula02/age.py +++ b/1ano/1semestre/fp/aula02/age.py @@ -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" diff --git a/1ano/1semestre/fp/aula05/shorten.py b/1ano/1semestre/fp/aula05/shorten.py index 0541025..4d2c969 100755 --- a/1ano/1semestre/fp/aula05/shorten.py +++ b/1ano/1semestre/fp/aula05/shorten.py @@ -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__":