title: Dice game with class
body: <p>I'm going crazy about an exercise. I have to make a dice game, where we are asked how many players will play the game, how many rounds will be played, and how many dice are used. Then, in the first round the dice are rolled; if a player can guess the number of a die, he gets a point for each die he guesses correctly; if he doesn't get any dice right, that's minus one point only. Then, I have to show each player their score. </p>
  
  <p>But the real problem is that I have to use classes and objects and that's the real problem.</p>
  
  <p>I would appreciate no comments that say this is some regular thing to do because I'm not very good with classes and objects and he could comment an idea of a program like this it would be great. Thank you very much </p>
  
  <pre><code>import random
  
  class Dice:
  
      def __init__(self,num_players,num_rounds,num_dices):
          self.num_players=num_players
          self.num_rounds=num_rounds
          self.num_dices=num_dices
  
      def roll(self):
          self.number=random.randint(1,6)
  
      def __str__(self):
          return str(self.number)
  
  def main():
  
      nPlayers=int(input('How many players? '))
      nRounds=int(input('How many rounds? '))
      nDices=int(input('How many dices will be used? '))
      game=Dice(nPlayers, nRounds, nDices)
      for i in range(nRounds):
          for j in range(nPlayers):
              game.roll()
              guess=int(input('Try guessing the number player'+str(j)+str(' ')))
  main()
  </code></pre>