Search code examples
pythonpython-3.xinttuplestypeerror

TypeError: '>=' not supported between instances of 'tuple' and 'int'


I was trying to build a simple and rudimentary code to see how many days would last my glory on a game and then when i tried to run this python threw this error

TypeError: '>=' not supported between instances of 'tuple' and 'int'

I checked my version on python, because i was working on Visual Studio, and turned out that i was using 3.7.7, the latest, from what i know Then i tried on python ide that had 3.4.4 and turned the same error First i thought was the version of python, 3.7.7, which is unstale, but then i switched to my Kali Linux and tried again and nothing changed, and i finally tried a online compiler, GDB,for those who knows it, it have 3.4.4 I don t know what i did wrong, please let me know

glory=10445
days=0
while glory>=7500:
    glory*=0,99
    days+=1
print(days)

Solution

  • Here's the problem:

    glory*=0,99
    

    It should be:

    glory*=0.99
    

    We use a dot . to separate decimals, not a comma , - a comma is used for separating elements in a list or a tuple, and that's what the error says.