我正在制作一个RPG战利品生成器,并且尝试对每种稀有物品的权重进行随机选择。我怎么做?
Item_rarity = ["Common", "Uncommon", "Superior", "Rare", "Legendary"]
Rarity_choice = random.choice(Item_rarity)
Run Code Online (Sandbox Code Playgroud)
我希望Common = 50%;罕见= 30%;上等= 14%; 稀有= 5%;传奇人物= 1%。我怎么做?