我应该编写一个程序来掷骰子五次,但我不能有任何冗余,也不能使用任何类型的循环。我将在此处粘贴练习中的文本。“构建一个 Python 应用程序,以便提示用户输入骰子的面数(龙与地下城式骰子!)之后,它将用该面数掷骰子五次,并将所有五个结果输出到用户掷骰子五次将需要五个重复的代码块——通过使用用户定义的函数掷骰子来消除这种冗余
谁能帮我?
import random
def main():
diceType = int(input("Enter how many sides the dices will have: "))
diceRoll1 = random.randint(1,diceType)
diceRoll2 = random.randint(1,diceType)
diceRoll3 = random.randint(1,diceType)
diceRoll4 = random.randint(1,diceType)
diceRoll5 = random.randint(1,diceType)
print("The dices read", diceRoll1, diceRoll2, diceRoll3, diceRoll4, diceRoll5)
main()