<?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>Forem: Jai Irkal</title>
    <description>The latest articles on Forem by Jai Irkal (@irkal_jai).</description>
    <link>https://forem.com/irkal_jai</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%2F672142%2Fad75e903-6ad1-4979-b4c7-4818fe580c5d.png</url>
      <title>Forem: Jai Irkal</title>
      <link>https://forem.com/irkal_jai</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/irkal_jai"/>
    <language>en</language>
    <item>
      <title>Stack Implementation Using Python</title>
      <dc:creator>Jai Irkal</dc:creator>
      <pubDate>Wed, 28 Dec 2022 14:55:12 +0000</pubDate>
      <link>https://forem.com/irkal_jai/stack-implementation-using-python-46oe</link>
      <guid>https://forem.com/irkal_jai/stack-implementation-using-python-46oe</guid>
      <description>&lt;h1&gt;
  
  
  How stack works and logic
&lt;/h1&gt;

&lt;p&gt;If we imagine a stack horizontally then...&lt;br&gt;
Element in stack is inserted in the same way we append an element to an array. So this logic could be used for the push function of our stack.&lt;br&gt;
Element is popped from the end of the stack so we have a direct pop() function which can be implemented in the pop function for this. pop() removes the first element from a list so we use pop(-1) to remove the last element.&lt;/p&gt;

&lt;h3&gt;
  
  
  This was a question from &lt;a href="https://practice.geeksforgeeks.org/problems/implement-stack-using-array/1?page=1&amp;amp;category[]=Arrays&amp;amp;curated[]=1&amp;amp;curated[]=7&amp;amp;sortBy=submissions" rel="noopener noreferrer"&gt;GeeksForGeeks Practice&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Ex: push(1), push(2), push(3), pop()&lt;br&gt;
    [1]       [1,2]   [1,2,3]   [1,2]&lt;/p&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;p&gt;`class MyStack:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def __init__(self):
    self.arr=[]

#Function to push an integer into the stack.
def push(self,data):
    #add code here
    self.arr.append(data)

#Function to remove an item from top of the stack.
def pop(self):
    #add code here
    if len(self.arr) &amp;gt; 0:
        popped = self.arr.pop(-1)
        return popped
    else:
        return -1`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Thank You. Hope you liked this solution. If there are better solutions or you have your own different solution then comment it below👍&lt;/p&gt;

</description>
      <category>emptystring</category>
    </item>
    <item>
      <title>My First Python Game</title>
      <dc:creator>Jai Irkal</dc:creator>
      <pubDate>Wed, 28 Jul 2021 17:17:12 +0000</pubDate>
      <link>https://forem.com/irkal_jai/stone-paper-scissor-game-546k</link>
      <guid>https://forem.com/irkal_jai/stone-paper-scissor-game-546k</guid>
      <description>&lt;p&gt;Hello coders and developers! &lt;br&gt;
This is the first game I have made a Stone-Paper-Scissors-Game using Python. I have not used any library like PyGame. I have developed it using the &lt;em&gt;random module&lt;/em&gt; in the &lt;strong&gt;Python Standard Library&lt;/strong&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  Python Standard Library
&lt;/h2&gt;

&lt;p&gt;Python Standard Library is a set of modules which are included with every Python installation.&lt;br&gt;
One of them used in this game is random module.&lt;/p&gt;
&lt;h2&gt;
  
  
  Random Module
&lt;/h2&gt;

&lt;p&gt;Important functions in the random module are &lt;em&gt;randint()&lt;/em&gt; and &lt;em&gt;choice()&lt;/em&gt;.&lt;br&gt;
In this game I have used the &lt;em&gt;choice()&lt;/em&gt; function.&lt;br&gt;
&lt;strong&gt;1. randint()&lt;/strong&gt; ---&amp;gt; This function returns any random integer within the given arguments.&lt;br&gt;
&lt;strong&gt;2. choice()&lt;/strong&gt; ---&amp;gt; This function returns a random value from a tuple or a list.&lt;/p&gt;

&lt;p&gt;Talking about my game, it takes a user input for stone paper or scissors and the computer chooses a random value i.e. stone paper or scissors. You know the rest rules I think 😉&lt;br&gt;
So this was the simple logic I used.&lt;/p&gt;

&lt;p&gt;The link for all the files is here. I have also converted the game into a module so that it looks clean 😁&lt;/p&gt;

&lt;p&gt;Happy Coding! 👨‍💻👩‍💻&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--A9-wwsHG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/JaiIrkal"&gt;
        JaiIrkal
      &lt;/a&gt; / &lt;a href="https://github.com/JaiIrkal/Stone-Paper-Scissors-Game"&gt;
        Stone-Paper-Scissors-Game
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Stone paper scissors game using Python
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Stone-Paper-Scissors-Game&lt;/h1&gt;

&lt;/div&gt;
&lt;p&gt;A simple stone paper scissors game like we used to play when we all were kids.
Simple Python is being used using the random module from Standard Python Library.&lt;/p&gt;
&lt;p&gt;I have also converted the game into module for simple use...&lt;/p&gt;
&lt;/div&gt;



&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/JaiIrkal/Stone-Paper-Scissors-Game"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


</description>
      <category>gamedev</category>
      <category>python</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Python Learning Sources</title>
      <dc:creator>Jai Irkal</dc:creator>
      <pubDate>Fri, 23 Jul 2021 18:59:18 +0000</pubDate>
      <link>https://forem.com/irkal_jai/python-learning-sources-32n7</link>
      <guid>https://forem.com/irkal_jai/python-learning-sources-32n7</guid>
      <description>&lt;p&gt;I have been using a lot of resources to learn Python Programming. As I myself am still learning, I wanted to share some resources I personally felt really helpful.&lt;/p&gt;

&lt;h2&gt;
  
  
  Book I would Recommend
&lt;/h2&gt;

&lt;p&gt;I won't prefer reading a book to learn programming but this book has impressed me a lot!&lt;br&gt;
I am referring to the book named 'Python Crash Course: A Hands On Project Based Introduction to Programming' by Eric Matthes. This book has been really helpful. Do give it a read and also practice the exercise questions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg2ady6w46kdpds7ldr81.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg2ady6w46kdpds7ldr81.png" alt="Alt Text" width="245" height="327"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After you are thorough with the book then you can go to W3Schools and solve those exercises(those are pretty easy questions). This will probably give you more confidence 👍&lt;/p&gt;

&lt;p&gt;Finally you have to solve problems from HackerRank. These questions might be a bit complex and tricky but more you try the more you learn. I myself had to do much to solve the problems. But no pain no gain!&lt;/p&gt;

&lt;p&gt;Useful YouTube videos related to python programming can be accessed through these links:&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/rfscVS0vtbw"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/_uQrJ0TkZlc"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/HGOBQPFzWKo"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;If you guys found this post helpful then save it so you can refer anytime 😊.&lt;br&gt;
Happy Coding! 👨‍💻 👩‍💻&lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>beginners</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
