The map() function in Python is a simple tool for applying a function to every item in an iterable, like a list. This turns data transformation into a straightforward task. Using map() , you can avoid traditional for loops, making your code cleaner and easier to read.
00:00So, first of all, we will discuss the map function.
00:04And in subsequent lectures, we will discuss the filter, zip and reduce functions.
00:08But at the moment, let's focus on map function.
00:11Now, I will go to the map function concept of the concept.
00:14I will go to you for a second.
00:17And when I was thinking, no, no, no, I had a definition of a code.
00:21So, I had compared it to a house with a house.
00:23I had to say, imagine, if you have a code,
00:26this is your code.
00:27So, this is two things we will get.
00:30One is action.
00:31I will say process.
00:32That's okay.
00:34Second is process.
00:37The process, it is on the top.
00:40So, I had, you said, exactly,
00:43a house, it was a house with a house.
00:45Like, this house with a house.
00:48Sorry, this house with a house.
00:51A house with a house.
00:54होती है एक घर है यह imagine करें यह टूटा-फूटा इसा गंदा सा ऐसा तो नर्सरी प्रैप का बच्चा नी बनाता घर एनिवेई यह हमारा घर है जी अब इस घर की खासियत यह है कि इस पे भी process चाहिए ठीक है लेकिन इसमें जो data है हमारा वो हमारा material है
01:10आप एसे ही अदा घर बनाते हैं वैसे code लिखते है प्रॉसस होता है घर पे यहने कि उस material के उपर आपको process करते हैं उसको एक शेप देते हैं तो वो दिवार बन जाती है उसको different process करते हैं, concrete बनाते हैं, सरीएड डालते हैं, छथत बन जाती है. ऐसे तरह data के जो हमारा code होता है
01:40call نہیں کرتے
01:41ہم نے جب بھی use کیا
01:44data کہیں اور پڑا ہوتا تھا process
01:46کہیں اور پڑا ہوتا تھا
01:47however map function کیا کرتا ہے
01:50کہ وہ process اور data
01:51کو single statement میں لے آتا ہے
01:53جب آپ map function use کرتے ہیں
01:55map process اور data
01:57single statement میں آ جاتا ہے
01:59اور code ہمارا compact ہو جاتا ہے
02:01I hope کہ یہ definition آپ کو clear ہو گئی ہوگی
02:03چلیے میں آپ کو ایک example دکھاتا ہوں
02:05اب example کو سمجھنے کے لیے
02:07اس سے پہلے ہم ایک exercise کرتے ہیں
02:09میں ایک ساتھ لے کے آ رہا ہوں
02:11exercise آپ نے کرنی ہے
02:12اور کرنا یہ ہے کہ میں آپ کو ایک list دے رہا ہوں