Python Forum
Please help me add all the results
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Please help me add all the results
#2
import random

def D4(x):

    rolls = 0
    for d4 in range(x):
        d4 = (random.randint)(1,5)
        rolls +=  d4

    return rolls

dicetotals = D4(4) 

print(dicetotals)
mr_kungfu likes this post
Reply


Messages In This Thread
Please help me add all the results - by mr_kungfu - Dec-10-2020, 08:23 PM
RE: Please help me add all the results - by michael1789 - Dec-10-2020, 09:17 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Search Results Web results Printing the number of days in a given month and year afefDXCTN 1 2,313 Aug-21-2020, 12:20 PM
Last Post: DeaD_EyE
  How to append one function1 results to function2 results SriRajesh 5 3,300 Jan-02-2020, 12:11 PM
Last Post: Killertjuh

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020