[Python] Python - When using comparison operators with strings, what determines is something...

Discussão em 'Python' iniciado por Stack, Março 26, 2025.

  1. Stack

    Stack Membro Participativo

    Inputting != and == operators between strings gives True/False outputs, but for some reason so do >, <, >=, and <=. What are the numbers behind the strings that it is using to make this comparison?

    >>> 'hi' > 'bye'
    True
    >>> 'hi' < 'bye'
    False
    >>> 'hi' >= 'bye'
    True

    Continue reading...

Compartilhe esta Página