<?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: Frank Friedland</title>
    <description>The latest articles on Forem by Frank Friedland (@onthefritz).</description>
    <link>https://forem.com/onthefritz</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%2F846506%2F4164871a-64df-4680-85ef-acde493b78a0.jpeg</url>
      <title>Forem: Frank Friedland</title>
      <link>https://forem.com/onthefritz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/onthefritz"/>
    <language>en</language>
    <item>
      <title>Very much a beginner...</title>
      <dc:creator>Frank Friedland</dc:creator>
      <pubDate>Tue, 12 Apr 2022 22:55:21 +0000</pubDate>
      <link>https://forem.com/onthefritz/very-much-a-beginner-15ph</link>
      <guid>https://forem.com/onthefritz/very-much-a-beginner-15ph</guid>
      <description>&lt;p&gt;Just found this community and I'm glad I did! Like my title says, very much a beginner, but my end goal for Python is to upskill and utilize it for network automation. &lt;/p&gt;

&lt;p&gt;I tackled a simple dice roller today that takes user input to determine how many sides and how many dice to roll. &lt;/p&gt;

&lt;p&gt;Going to add in an error if the user inputs letters into the dice side/number inputs as well as make the "yes" answer more inclusive of capitalization. Please feel free to tear it apart or give me ideas on anything I can add!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import random

# Determine a random side for each number rolled
def rollDice():

# Get how many sides a dice has
    print("How many sides does the dice have?" )
    diceSideNum = input()

# Get number of those dice to role
    print("How many " + diceSideNum + " sided dice should we roll? ")
    diceNum = input()

# incr variable to increment by 1 to roll correct amount of dice
    incr = 0

# while incr doesn't equal number of dice rolled, iterate.
    while int(incr) != int(diceNum):
# random dice number is between 1 and the # chosen by the user
        num = random.randrange(1, int(diceSideNum))
# Side of the dice randomly chosen and printed to display
        print(num)
# test incremented by 1
        test += 1
# reroll() asks essentially to play again.
    reroll()

def reroll():
    reroll = input("Roll again? ")
    if reroll == "yes":
        rollDice()
    else:
        print("Good-bye")

rollDice()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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