# Python Increment and report number of round in print statement

Page 1 of 1

## 2 Replies - 224 Views - Last Post: 14 February 2019 - 07:33 AMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'https://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=414910&amp;s=54cb9b10317ea2bb05907f9825d07def&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 fmak916

Reputation: 0
• Posts: 13
• Joined: 14-June 18

# Python Increment and report number of round in print statement

Posted 14 February 2019 - 04:56 AM

Hello

I am working on a mini dice game. I pretty much finish the game but I got stuck on how to increment counts for the print statement.
My output should be: Round # 1 You rolled a 6 and a 4, Round # 2 You rolled a 3 and a 2... / Round # 1 You rolled a 6 and a 6. You got a DOUBLE, Round # 2 6 and a 6. You got a DOUBLE.
any advice would be appreciated?? Thank you!!

```#Homework 4 - Loops (randomness with dice)
import random

rollAgain = input('Do you want to roll again? Press Enter/Return to roll, n to quit')
count = 0
while count == 'y':
count = count +1

while rollAgain != 'n' or rollAgain == 'y':
diceOne = random.randint(1, 6)
diceTwo = random.randint(1, 6)

if diceOne == diceTwo:
print('Round#', int.count,'You rolled a', diceOne, 'and', 'a', diceTwo)
print('You got DOUBLES!')
print('You rolled a double. 16.6666667% chance')
else:
print('Round#', int.count, 'You rolled a', diceOne, 'and', 'a', diceTwo)

rollAgain = input ('Do you want to roll again? Press Enter/Return to go again, n to quit ')

```

Is This A Good Question/Topic? 0

## Replies To: Python Increment and report number of round in print statement

### #2 DK3250

• Pythonian

Reputation: 513
• Posts: 1,633
• Joined: 27-December 13

## Re: Python Increment and report number of round in print statement

Posted 14 February 2019 - 06:29 AM

Many small things:
1. the while loop in line 6 is strange, remove it
2. line 7 should be inside the main loop (after line 9)
3. 'int.count' in line 14 and 18 - where did you get this? should only be 'count'
4. line 20 should be outdented one level as it controls the while loop
5. line 9: " or rollAgain == 'y'" is superfluous.

### #3 fmak916

Reputation: 0
• Posts: 13
• Joined: 14-June 18

## Re: Python Increment and report number of round in print statement

Posted 14 February 2019 - 07:33 AM

DK3250, on 14 February 2019 - 06:29 AM, said:

Many small things:
1. the while loop in line 6 is strange, remove it
2. line 7 should be inside the main loop (after line 9)
3. 'int.count' in line 14 and 18 - where did you get this? should only be 'count'
4. line 20 should be outdented one level as it controls the while loop
5. line 9: " or rollAgain == 'y'" is superfluous.

Thanks for pointing out the small mistakes. Noted.

3. I was googling for a bit and I was just trying anything. : )

Thanks a bunch!!!