Comparison operators evaluate relationships between values and produce results that can control program flow. The guessing exercise applies ==, <, and > to compare a converted user guess with a randomly generated integer. section 2.3
Use the operators with these constraints and supporting techniques:
- Use == and != to compare values regardless of type; use < and > with values of the same type. section 2.3
- Convert input with int before comparing it with a numeric answer, because input always returns a string. section 2.3
- Place comparisons inside while True and exit with break when the guess matches the selected answer. section 2.3
Number guessing
Generate an answer with random.randint, convert the user's input to an integer, and compare the guess with ==, <, or > until it matches. section 2.3







