import random def aa(n): q=0 while n: m=random.randint(1,6) q +=m n -=1 return q print(aa(5)) 转载于:https://www.cnblogs.com/xzm123/p/9870849.html