New to python here, trying to make a simple dice roller, created a func() that returns 3 variables after user input. Is there any way to make one function for the creation of the roll? tried with range but had no luck
import random
def user_input():
y = int(input("Number of yellow dice to roll? : "))
g = int(input("Number of Green dice to roll? :"))
b = int(input("Number of Black dice to roll? :"))
return y, g, b
y, g, b = user_input()
for n in range(y):
print("Yellow Dice",n+1,":",random.randint(1,6))
for n in range(g):
print("Green Dice",n+1,":",random.randint(1,6))
for n in range(b):
print("Black Dice",n+1,":",random.randint(1,6))