[Misc]slots xp0int Posted on Oct 28 2018 # slots <br> 在python中`float('nan')`会出返回nan,代表不是一个数字,但是并不会报错,且可以和数字做比较结果一律为Flase,与数字做运算一律为nan.<br> 第一处检查:(可以通过,原因见上) ```python3 try: bet = float(bet) except: req.sendall('Your bet must be a number!\n') req.close() return if bet <= 0: req.sendall('Sneaky, but not good enough.\n') req.close() return elif bet > money: req.sendall('You don\'t have enough money to wager this.\n') req.close() return ``` 第二处运算:(运算后money为nan) ```python win = bet * payout(line2) money += win - bet ``` 第三处比较:(因为money为nan所以会进入最后一个else) ```python if money <= 0: req.sendall('You have no money left. Low roller.\n') req.close() return elif money < 1000000000: req.sendall('Play more to become a high roller!\n') else: req.sendall('Wow, you\'re a high roller!\n') req.sendall('A flag: {}\n'.format(flag)) return ``` 打赏还是打残,这是个问题 赏 Wechat Pay Alipay [Misc]bitcoin_base [Misc]加密了吗
没有帐号? 立即注册