我正在开发一个投币游戏,它将您输入的价值添加到您的余额中
之前的代码片段:
deposit = input("Enter how much to deposit")
money = file1.read()
resultmonecoin = int(money)-int(deposit)
测试 Tails 是否正确的主要代码
elif flipresults == "Tails":
print("You flip the coin")
time.sleep(2)
print("It's tails")
if HORT.upper() == "T" or "t":
wincoin = int(deposit)*2
print("You won",wincoin)
howmuchwin = wincoin+money
print("Total:",int(howmuchwin))
else:
print("You lost that one. You now have",resultmonecoin)
game()
else:
print("This input wasn't understood!")
flip()
注意:货币变量类似于500
或200
问题:
[H] 领先或 [T] 落后 T
你抛硬币
是尾巴
你赢了 468
Traceback (most recent call last):
File "C:\Users\yeet\Desktop\Casino.py", line 40, in flip
howmuchwin = wincoin+money
TypeError: unsupported operand type(s) for +: 'int' and 'str