<?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: ibrahim s m a</title>
    <description>The latest articles on DEV Community by ibrahim s m a (@ibrahimsma).</description>
    <link>https://dev.to/ibrahimsma</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%2F673648%2Ff57159a9-de20-4794-907a-09a338dbba5d.jpeg</url>
      <title>DEV Community: ibrahim s m a</title>
      <link>https://dev.to/ibrahimsma</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ibrahimsma"/>
    <language>en</language>
    <item>
      <title>#MyFirstPost #python #Beginners</title>
      <dc:creator>ibrahim s m a</dc:creator>
      <pubDate>Sun, 25 Jul 2021 13:07:25 +0000</pubDate>
      <link>https://dev.to/ibrahimsma/myfirstpost-python-beginners-31mc</link>
      <guid>https://dev.to/ibrahimsma/myfirstpost-python-beginners-31mc</guid>
      <description>&lt;p&gt;&lt;strong&gt;Problem 1 - If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Find the sum of all the multiples of 3 or 5 below 1000.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Solution:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;total = 0
for number in range(1, 1000):
    if number % 3 == 0 or number % 5 == 0:
        total += number
print(f'The sum of all the multiples of 3 or 5 below 1000 is : {total}')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Solution guidelines&lt;/strong&gt;:&lt;br&gt;
1) Assign initial total as 0.&lt;br&gt;
2) Loop over the range from 1 to 999&lt;br&gt;
3) if any number is divisible by 3 or 5&lt;br&gt;
4) Add that number to the total&lt;br&gt;
5) Finally, print the total number&lt;/p&gt;

</description>
      <category>python</category>
      <category>beginners</category>
      <category>firstpost</category>
    </item>
  </channel>
</rss>
