<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic 2.1.3.8 Lab - create a simple game with python IDLE in DevNet General Discussions</title>
    <link>https://community.cisco.com/t5/devnet-general-discussions/2-1-3-8-lab-create-a-simple-game-with-python-idle/m-p/4139845#M1333</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Having written the code as I saw it and corrected evident errors while trying to run the code in python IDLE, i do not know why i am unable to type/insert a number do the program can continue running.&lt;/P&gt;&lt;P&gt;Task is to create a game where the program guesses the number the player chooses.&lt;/P&gt;&lt;P&gt;assistance please.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vb.png" style="width: 704px;"&gt;&lt;img src="https://community.cisco.com/t5/image/serverpage/image-id/82038iD4D3B723FD00C7C9/image-size/large?v=v2&amp;amp;px=999" role="button" title="vb.png" alt="vb.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 23 Aug 2020 02:38:21 GMT</pubDate>
    <dc:creator>Khadkay</dc:creator>
    <dc:date>2020-08-23T02:38:21Z</dc:date>
    <item>
      <title>2.1.3.8 Lab - create a simple game with python IDLE</title>
      <link>https://community.cisco.com/t5/devnet-general-discussions/2-1-3-8-lab-create-a-simple-game-with-python-idle/m-p/4139845#M1333</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Having written the code as I saw it and corrected evident errors while trying to run the code in python IDLE, i do not know why i am unable to type/insert a number do the program can continue running.&lt;/P&gt;&lt;P&gt;Task is to create a game where the program guesses the number the player chooses.&lt;/P&gt;&lt;P&gt;assistance please.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vb.png" style="width: 704px;"&gt;&lt;img src="https://community.cisco.com/t5/image/serverpage/image-id/82038iD4D3B723FD00C7C9/image-size/large?v=v2&amp;amp;px=999" role="button" title="vb.png" alt="vb.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Aug 2020 02:38:21 GMT</pubDate>
      <guid>https://community.cisco.com/t5/devnet-general-discussions/2-1-3-8-lab-create-a-simple-game-with-python-idle/m-p/4139845#M1333</guid>
      <dc:creator>Khadkay</dc:creator>
      <dc:date>2020-08-23T02:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: 2.1.3.8 Lab - create a simple game with python IDLE</title>
      <link>https://community.cisco.com/t5/devnet-general-discussions/2-1-3-8-lab-create-a-simple-game-with-python-idle/m-p/4933577#M2099</link>
      <description>&lt;P&gt;It seems like you're working on a number guessing game where the program guesses the number chosen by the player. To help you further, I'd need to see the code you've written so far. However, I can provide you with a simple outline of how you can implement such a game in Python:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Import the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;random&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;module to generate random numbers.&lt;/LI&gt;&lt;LI&gt;Define the minimum (min_number) and maximum (max_number) values for the range of numbers the player can guess.&lt;/LI&gt;&lt;LI&gt;Generate a random target number within the specified range using&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;random.randint.&lt;/LI&gt;&lt;LI&gt;Initialize variables for tracking the number of guesses (guesses) and whether the guess is correct (is_guess_correct).&lt;/LI&gt;&lt;LI&gt;Print a welcome message and instructions to the player.&lt;/LI&gt;&lt;LI&gt;Enter a&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;while&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;loop that continues until the player's guess is correct.&lt;/LI&gt;&lt;LI&gt;Inside the loop:&lt;UL&gt;&lt;LI&gt;Attempt to get the player's guess as an integer using&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;input&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;int.&lt;/LI&gt;&lt;LI&gt;Increment the number of guesses.&lt;/LI&gt;&lt;LI&gt;Check if the guess is correct, too low, or too high and provide appropriate feedback to the player.&lt;/LI&gt;&lt;LI&gt;Handle invalid input with a&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;try&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;except&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;block, informing the player to enter a valid number.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;Once the player guesses the correct number, exit the loop and print a congratulatory message with the target number and the number of guesses it took.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;You can take this breakdown and write the code in your Python environment. If you encounter any specific issues while implementing it, feel free to ask for help with those particular problems.&lt;/P&gt;&lt;P&gt;This code sets up a simple number guessing game where the player needs to guess the randomly generated target number within a specified range. It uses a&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;while&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;loop to continue taking guesses until the player guesses correctly.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Oct 2023 17:49:58 GMT</pubDate>
      <guid>https://community.cisco.com/t5/devnet-general-discussions/2-1-3-8-lab-create-a-simple-game-with-python-idle/m-p/4933577#M2099</guid>
      <dc:creator>sufianbaloch7867</dc:creator>
      <dc:date>2023-10-03T17:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: 2.1.3.8 Lab - create a simple game with python IDLE</title>
      <link>https://community.cisco.com/t5/devnet-general-discussions/2-1-3-8-lab-create-a-simple-game-with-python-idle/m-p/5012163#M2230</link>
      <description>&lt;P&gt;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/1073354"&gt;@Khadkay&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Has this been resolved?&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2024 18:36:05 GMT</pubDate>
      <guid>https://community.cisco.com/t5/devnet-general-discussions/2-1-3-8-lab-create-a-simple-game-with-python-idle/m-p/5012163#M2230</guid>
      <dc:creator>Ruben Cocheno</dc:creator>
      <dc:date>2024-02-02T18:36:05Z</dc:date>
    </item>
  </channel>
</rss>

