Python之购物车实战(练习字典、random函数)
import randomuser_name = "guojie"user_passwd = "123456"shopping_list = {"苹果":5,"香蕉":10,"榴莲":15,"芒果":20,"梨":25}#随机生成四位验证码while True: user_code = random.choice(range(1000, 10000))