python中编写抽奖小游戏

>>> prizes = ["aaa","bbb","ccc","ddd","eee"]
>>> import random
>>> for i in range(1,11,1):        ## 设计抽十次
    print(f"The {i}th prize is {random.choice(prizes)}!")

    
The 1th prize is ddd!
The 2th prize is ddd!
The 3th prize is bbb!
The 4th prize is ddd!
The 5th prize is ddd!
The 6th prize is eee!
The 7th prize is ccc!
The 8th prize is bbb!
The 9th prize is eee!
The 10th prize is aaa!
原文地址:https://www.cnblogs.com/liujiaxin2018/p/14156693.html