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