Notice: Undefined offset: 15187771 in /var/www/html/qa-external/qa-external-users.php on line 744

Notice: Undefined offset: 16764679 in /var/www/html/qa-external/qa-external-users.php on line 744
Why isn't > or < working in my code? - OnlineGDB Q&A
Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

Why isn't > or < working in my code?

+4 votes
asked Sep 30, 2025 by Landon (160 points)
I have been learning python recently and for one one of my lines (following a YT tutorial), its says that the > or >= isn't supported between instances of 'int' and 'function' and im a little confused.

Heres my code

if Total_bet >= balance:
            print(f"your too broke, your current balance is: ${balance}")
        else:
            break

2 Answers

+2 votes
answered Oct 1, 2025 by (180 points)
balance = 100   
Total_bet = 20  

if Total_bet >= balance:
    print(f"You're too broke, your current balance is: ${balance}")
else:
    break
commented Oct 6, 2025 by Mikah Duncan (200 points)
bckigtrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj                                                                           jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
commented Oct 6, 2025 by Mikah Duncan (200 points)
r4mfdhhwqsdejhwjesfnctrhdszhdxzqvsAHVzJVDBSANGTF7Y
commented Oct 6, 2025 by Mikah Duncan (200 points)
FEHEHERHFQWHERH
commented Oct 7, 2025 by yash saharan (100 points)
it a very good question
+2 votes
answered Oct 1, 2025 by cpp guy (1,020 points)

The problem is not relevant to ur usage of > and <, it is just that ur indentation is not correct - 'else' should be aligned with 'if'

Correct version: 

if Total_bet >= balance:
            print(f"your too broke, your current balance is: ${balance}")

else:
            break

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and receive answers from other members of the community.
...