<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ara on Medium]]></title>
        <description><![CDATA[Stories by Ara on Medium]]></description>
        <link>https://medium.com/@224003072?source=rss-243342e339a8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by Ara on Medium</title>
            <link>https://medium.com/@224003072?source=rss-243342e339a8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 03:30:59 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@224003072/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[map() function is primarily used to apply a single function to each element in an iterable (like a…]]></title>
            <link>https://medium.com/@224003072/map-function-is-primarily-used-to-apply-a-single-function-to-each-element-in-an-iterable-like-a-5df320225dd0?source=rss-243342e339a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/5df320225dd0</guid>
            <category><![CDATA[map-in-python]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Ara]]></dc:creator>
            <pubDate>Thu, 24 Aug 2023 06:26:08 GMT</pubDate>
            <atom:updated>2023-08-24T06:48:25.967Z</atom:updated>
            <content:encoded><![CDATA[<p>map() function is primarily used to apply a single function to each element in an iterable (like a list) and return an iterable of the results.</p><pre>def double(x):<br>    return x * 2<br><br># Create a list of numbers<br>numbers = [1, 2, 3, 4, 5]<br><br># Use map to apply the &#39;double&#39; function to each number in the list<br>result = map(double, numbers)<br>#double function inside the iterable list<br><br># Convert the map object to a list<br>doubled_numbers = list(result)<br><br># Print the doubled numbers<br>print(doubled_numbers)<br></pre><p>Use also lambda function</p><pre>def add(x, y):<br>    return x + y<br><br># Create a list of pairs<br>pairs = [(1, 2), (3, 4), (5, 6)]<br><br># Using map() to apply the &#39;add&#39; function to each pair in the list<br>sums = list(map(lambda pair: add(pair[0], pair[1]), pairs))<br><br># Print the sums<br>print(sums)<br></pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5df320225dd0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>