From 7abfae34543e27e24a97841d2dc180e4fb4027bd Mon Sep 17 00:00:00 2001 From: Naveen Sai <38736123+naveen675@users.noreply.github.com> Date: Sat, 22 May 2021 12:49:55 +0530 Subject: [PATCH] Added Another solution for question 13 Using Filter function --- Status/Day 3.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Status/Day 3.md b/Status/Day 3.md index cf099fa..b695d68 100644 --- a/Status/Day 3.md +++ b/Status/Day 3.md @@ -381,6 +381,22 @@ def count_letters_digits(counters,char_to_check): print('LETTERS {0}\nDIGITS {1}'.format(*reduce(count_letters_digits,input(),[0,0]))) ``` +```python +'''Solution by: Naveen + +#using filter function + +def check_letter(i): + if i.isalpha(): + return i +def check_number(i): + if i.isdigit(): + return i + + l = list(input()) + print("Letter "+ str(len(list(filter(check_letter,l) ) ) ) ) + l = list(input()) + print("Letter "+ str(len(list(filter(check_letter,l) ) ) ) ) --- ## Conclusion