请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

为什么没法转换成int的?

'''
    购买1级石头
'''
l1_value = 0.75
l1_value_diamond = 8

'''
    1级合成3级
'''
l1_to_l3 = 12
l1_to_l3_gold = 0.39
l1_to_l3_vit = 10

'''
    3级合成4级
'''
l3_to_l4 = 16
l3_to_l4_gold = 0.897
l3_to_l4_vit = 10
l3_to_l4_rate = 0.4878

'''
    4级合成6级
'''
l4_to_l6 = 12
l4_to_l6_gold = 19.75
l4_to_l6_vit = 10

'''
    汇率
'''
diamond_value = 0.05  #钻石
vit_value = 1  #体力

'''
玩家自己合成
'''
def  Player():
    l1 = l1_value*12 + l1_value_diamond*0.05
    l1_l3 = l1 + l1_to_l3_vit*1 + l1_to_l3_gold
    l3_l4 = (l1 + l1_value*4 + l3_to_l4_vit*10 + l3_to_l4_gold)*(1/0.4878)
    def Player1():
        if l3_l4 > (1-(1/0.4878)):
          return l3_l4 + l3_l4+(l3_to_l4_vit*10)
        elif l3_l4 == 0.4878:
            return l3_l4
    l4_l6 = l1 + l4_to_l6_vit*1 +l4_to_l6_gold
    play = l3_l4 + Player1()+ l1_l3 + l3_l4 + l4_l6
    print(play)
Player()

a = int(750)
b = Player()
if b>a:
    print("购买更划算")
elif b<a:
    print("合成更划算")

    

正在回答 回答被采纳积分+3

1回答

7七月 2020-09-17 00:03:41

不要只贴代码,不然 怎么理解 不能转成int。啥意思?

0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信