Back

Sanskar

Keen Learner and Exp... • 3d

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 • 10m

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... • 16d

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
Image Description

Sanskar

Keen Learner and Exp... • 20d

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
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

Sidharth Bidikar

Keep Moving • 10m

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

Ashish Kushwaha

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

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

Reply
2

Sanskar

Keen Learner and Exp... • 9d

Day 12 of learning python as a beginner. Topic: object oriented programming (OOP). Yesterday I shared a journal taking app and many people suggested that it would be great if I used classes. Initially I was not aware of what classes actually are an

See More
Reply
2

Sanskar

Keen Learner and Exp... • 10d

Day 11 of learning python as a beginner. Topic: creating journal entry program using file I/O. I got a little sidleline from my original plan of editing my to-do list program and created an entirely new program this time for writing a daily journal

See More
Reply
1
10
Image Description
Image Description

Lokender Singh Tomar

Hey I am on Medial • 7m

I have a solution of pollution with scientific report and patent in which all vehicles will filter air by themselves. But nobody is willing to even tallk to me . I am searching for a platform to present this world saving project. If you know any plea

See More
4 Replies
3

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