Define a function dice(n) that returns the sum of a random roll of n 6-sided dice. Example output in photo. Thank you

Answer:
code (in python) is in the explanation
Explanation:
import random
def dice(n):
count = 1
t = list()
while count <= n:
i = random.randint(1,6)
t.append(i)
count += 1
print(sum(t))
Hope this helps!