有没有办法确定 python 掷骰子的成功?

Is there a way to determine successes in a python dice roller?

我是编程新手(比如非常新),我决定为我最喜欢的角色扮演游戏 Vampire the Masquerade 制作一个骰子滚轮。对于那些不知道的人,当你想在 VtM 中掷骰子时,你会掷出 d10s(十面骰子)的骰子池,然后你是否成功取决于你掷出的“成功”数量;任何骰子结果为 6 或更多。

到目前为止,我已经成功制作了一个只滚动 d10s 的基本滚筒:

#"d" is the number of dice
def roll(d):
    return [randint(1,10) for i in range(d)]

#Main Program
d = int(input("\nHow many dice are you rolling? > "))
results = roll(d)
print(results)

但是,我无法让程序计算滚动中的成功次数。我希望输出看起来像

How many dice are you rolling? > 2
[5, 9]
1 success

有什么建议吗?

就这样:

d = int(input("\nHow many dice are you rolling? > "))
results = roll(d)
print(results)
x = sum(i >= 6 for i in results)
print([f'{x} success', 'failure'][not x])

倒数第二行也可以变成:

x = sum(1 for i in results if i >= 6)