[FP] Quick simplifications
This commit is contained in:
parent
f9bb9f1450
commit
ca711863a7
|
@ -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"
|
||||
|
|
|
@ -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__":
|
||||
|
|
Loading…
Reference in New Issue