I am writing a dice rolling simulation and i need help redefining a variable inside a loop.
Arrorn
-4
Light Poster
Recommended Answers
Jump to PostPut the roll statement under one of the while loops
roll = random.randint(1,6)
Now, it is only executed once at the beginning of the program. Also, instead of all of the if/elif you can use a list or dictionary and increment, for example
counter_list[roll] += 1
You will have to …
All 4 Replies
Arrorn
-4
Light Poster
woooee
814
Nearly a Posting Maven
Arrorn
-4
Light Poster
woooee
814
Nearly a Posting Maven
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.