Back

Sanskar

Keen Learner and Exp... • 26d

Day 17 of learning python as a beginner. Topic: lambda functions + email filter Lambda functions are a single line anonymous function without using the usual def key word. All function: checks whether all the key words (spam_keywords) are present in the email, that's why I have used "not in" function with it so the translation would be: check if all keywords not present in the email. If there is a single keyword present the condition will become false. I used this method to filter out the important emails. I used "any" function to check if any of the keyword is present in the email if present then the condition would be false and email will be treated as a spam. I know that I could have just used an if else condition instead of writing these two things separately however I purposefully wrote those two things seperately first to get familiar with "all" and "any" key word, second to know the effect of "not in" and "in" functions and third to write lambda function twice as a practice (sounds strange I know). I have then used File I/O to keep spammed emails and safe email in separate file for user review in future. As you can tell I tried to create a google like email filter and I think there's a lot more things I can add in this. I will appreciate any suggestion, challenge or future learning options (I still think I need to get my hand a better in modular programming). And here's my code and its result.

Reply
2

More like this

Recommendations from Medial

Sidharth Bidikar

Keep Moving • 11m

Which function allows you to count the number of cells that meet a specific condition? #excel #msexcel #data #dataanalytics #googlesheets #functions

Reply
2

Sanskar

Keen Learner and Exp... • 1m

Day 5 of learning python as a beginner. Topic: Functions On my previous day post many people shared their github where I was introduced to def functions and since then I started learning more about def functions. Thank you all those people who are

See More
Reply

Sanskar

Keen Learner and Exp... • 14d

Day 30 of learning python as a beginner. Topic: making a fully functional calculator. Yesterday I got introduced to tkinter and was successful in creating a basic graphical layout for the calculator and today I added logic into it and now I finally

See More
Reply
2
Image Description

Hari Krishna

Developer | entrepre... • 1d

Day6/100: • def —> Creating a function ( user defined) def name(): Condition Name() —> calling the function 🤙🏻 ————— Likewise we can create a library 📚 in python 🐍 • import ( the file we created ) ————— Today played with Reeborg rob

See More
1 Reply
8
Image Description

Sanskar

Keen Learner and Exp... • 1m

Day 2 of learning python as a beginner. Topic: Conditional Expression Conditional expression pose a condition (if and Else statements). They help program take decision based on the condition given. They can be used inside a function or while assign

See More
4 Replies
4
15
Image Description
Image Description

Arpit Shukla

Helping people achie... • 1m

Why are we still coding in programming languages when plain but exact English statements should be used to define what functions and methods should do. Just a vision: 1. Let everyone (not only developers) write modular functions with plain English d

See More
8 Replies
14

Sanskar

Keen Learner and Exp... • 20d

Day 24 of learning python as a beginner. Topic: decorators Somebody has suggested me that I should focus on some of the important things and he gave me a list of topics to learn. Decorators were at very top of that list and therefore I decided to l

See More
Reply
1

Sidharth Bidikar

Keep Moving • 11m

Which function can be used to combine text from different cells into one cell without using the CONCATENATE function? A) TEXTJOIN B) CONCAT C) JOIN #excel #dataanalyst #data #dataanalysis #dataanalytics

Reply
1
6
Image Description
Image Description

Abhishek Roy

Hey I am on Medial • 1y

How do I check which email Id I logged in with? I forgot my email id tht I used to sign up here.

6 Replies
3

Ashish Kushwaha

CSE '25 || Java, JSw... • 24d

Can anyone tell me how to fix this Patch function in Node Js. I have also used chatGPT but nothing happened🥲

Reply
2

Download the medial app to read full posts, comements and news.