143k views
5 votes
If (x > 5 AND x <= 10): print (OK)

1 Answer

0 votes

Answer:

If (x > 5 AND x <= 10): print (OK)

This is in Python, and there are errors.

Step-by-step explanation:

Variable x is not defined. And OK should be within inverted commas and AND should be in lower case, like as below:

x=int(input("Enter X:"))

if (x>5 and x <=10?): print("OK")

If now x is between 5 and 10 or 10, then the output will be OK. or else it might return some exception value as that case is not definitely in try-catch. Always ensure that you have output defined for each case.

User QuadrupleA
by
6.6k points