-1

入力した値を残高に追加するコインフリップゲームに取り組んでいます

以前のコードのスニペット:

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()

注: money 変数は、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
4

1 に答える 1