Python TypeError: unorderable types: builtin_function_or_method() < int()
Question: I keep getting this error while trying to do a Python program. The point of
the program is to keep on rolling a set of die, until the user enters a number
less than 0.

    
    
    import random
    
    num_sixes = 0
    num_sevens = 0
    num_rolls = int(input('Enter number of rolls:\n'))
    
    while (input <= 1):
        for i in range(num_rolls):
            die1 = random.randint(1,6)
            die2 = random.randint(1,6)
            roll_total = die1 + die2
    
        #Count number of sixes and sevens
        if roll_total == 6:
            num_sixes = num_sixes + 1
        if roll_total == 7:
            num_sevens = num_sevens + 1
        print('Roll %d is %d (%d + %d)' % (i, roll_total, die1, die2))
    
        print('\nDice roll statistics:')
        print('6s:', num_sixes)
        print('7s:', num_sevens)
    else:
        print('Invalid number of rolls. Try again.')
    

Here's the traceback:

    
    
    Traceback (most recent call last):
      File "unorderable.py", line 7, in <module>
        while (input <= 1):
    TypeError: unorderable types: builtin_function_or_method() <= int()
    


Answer: You are comparing whether the built-in function `input` is less than or equal
to 1

    
    
    while (input <= 1):
    

Did you mean to do this instead?

    
    
    while (num_rolls > 0):
    

