第十天 跟着B站学python lol之购买武器

username=int(input('请输入您的ID:'))
password=int(input('请输入您的密码:'))
if username== 2 and password==123:
    print('欢迎来到召唤师峡谷')
    hero_list=[['盲僧'],['亚索'],['猴子'],['赵信'],['盖伦'],['诺手'],]
    print(hero_list)
    while True:
        hero_1=input('请选择您的英雄:')
        hero=[]
        hero.append(hero_1)
        if hero in hero_list:
            coins=1000        #初始金币为1000,
            print('{2}选择{1},初始金币为{0}'.format(coins,hero,username))
            break
        else:
            print('选择错误请重新选择。')
while True:
    weapon_list=[]
    print('1.购买武器','2.开始作战','3.删除武器 换装','4.退出游戏')
    choice=int(input('请选择操作:'))
    if choice==1:
        weapons=[['饮血剑',100],['无尽之刃',200],['女妖',200],['狂徒',900],['冰心',1400],['三相',500]]
        for weapon in weapons:
            print(weapon[0],end=' ,')
        print()
        i=1
        while i<=1:                
            weapon_buy=input('请购买您的武器:')
            for weapon in weapons:
                if weapon_buy==weapon[0]:
                    if coins >= weapon[1]:
                        weapon_list.append(weapon_buy)
                        coins-=int(weapon[1])
                        print('您的剩余金币是:{}'.format(coins))
                    else:
                        print('金币不足,请作战获取金币',end=' ');print('您的剩余金币是:{}'.format(coins))
                        i+=1
        print('您拥有的武器是:{}'.format(weapon_list))
    elif choice==2:
        pass
    elif choice==3:
        pass
    elif choice==4:
        print('退出游戏成功')

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

梅_花_七

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值