<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Shuhaib S</title>
    <description>The latest articles on DEV Community by Shuhaib S (@shuhaibz_s).</description>
    <link>https://dev.to/shuhaibz_s</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F676339%2F29a1d0dd-71c7-4258-8b48-4965f085dc28.jpeg</url>
      <title>DEV Community: Shuhaib S</title>
      <link>https://dev.to/shuhaibz_s</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shuhaibz_s"/>
    <language>en</language>
    <item>
      <title>List comprehensions in python</title>
      <dc:creator>Shuhaib S</dc:creator>
      <pubDate>Sun, 13 Nov 2022 15:37:14 +0000</pubDate>
      <link>https://dev.to/shuhaibz_s/list-comprehensions-in-python-5372</link>
      <guid>https://dev.to/shuhaibz_s/list-comprehensions-in-python-5372</guid>
      <description>&lt;p&gt;&lt;strong&gt;List in python&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Lists are used to store multiple items in a single variable. Lists are one of 4 built-in data types in Python used to store collections of data, the other 3 are Tuples, Set, and Dictionary, all with different qualities and usage.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to mutate the value and set the new value in list?
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nums = [1,2,3,4]

## we can double this value with 2 ( num *2 ) 

doubled = [x * 2 for x in nums ]

## output is : [2, 4, 6, 8]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;How it worked?&lt;/strong&gt;&lt;br&gt;
each iteration the x will be stored as calculated with 2 &lt;/p&gt;

&lt;h2&gt;
  
  
  How to filter the list?
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nums = [1,2,3,4]

## we can double this value with 2 ( num *2 ) 

filtered = [x  for x in nums if x &amp;gt; 2]

## output is : [3, 4]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;How it worked?&lt;/strong&gt;&lt;br&gt;
each iteration the x will be checked with the condition and stored&lt;/p&gt;

&lt;h2&gt;
  
  
  How to filter the List of dictionaries?
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;names = [
{"name":"abil"}, {"name":"john"},{"name":"willing"},{"name":"sam"}
]

## we can double this value with 2 ( num *2 ) 

filtered_names = [item  for item in names if item.startswith("s")]

## output is : [{"name":"sam"}]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;How it worked?&lt;/strong&gt;&lt;br&gt;
each iteration the x will be checked with the condition and stored&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>python</category>
      <category>lis</category>
      <category>shuhaib</category>
    </item>
    <item>
      <title>How to Render React with express.js together</title>
      <dc:creator>Shuhaib S</dc:creator>
      <pubDate>Sat, 12 Nov 2022 17:57:34 +0000</pubDate>
      <link>https://dev.to/shuhaibz_s/how-to-render-react-with-expressjs-together-2a8h</link>
      <guid>https://dev.to/shuhaibz_s/how-to-render-react-with-expressjs-together-2a8h</guid>
      <description>&lt;p&gt;Hi guys, this is a way to run the react and express in a single server and a static way&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a react project and write your code.&lt;/li&gt;
&lt;li&gt;Create an express project.&lt;/li&gt;
&lt;li&gt;Run the express project.&lt;/li&gt;
&lt;li&gt;Link the express backend with react and build.&lt;/li&gt;
&lt;li&gt;Set the react project build folder as static in the express.&lt;/li&gt;
&lt;li&gt;And re-run the express project.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; app.use(express.static(path.join(__dirname, 'build')))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;working&lt;/strong&gt;&lt;br&gt;
The react project will be bundled together through the build. And it will contain an HTML file so the HTML file will be rendered when the express project run. So the HTML file will available for the end user and  &lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>express</category>
      <category>react</category>
    </item>
  </channel>
</rss>
