[Solved] i’ve generated random numbers. Now i want to add all the numbers that are generated. What is the code to add them [closed]

[ad_1]

Use a total variable and add the generated number to the total

import random

x = 0
total = 0
while x<10:
    number = random.randrange(1,10)
    print(number)
    total += number
    x=x+1
print(total)

0

[ad_2]

solved i’ve generated random numbers. Now i want to add all the numbers that are generated. What is the code to add them [closed]