1

How do I write the following in a single if statement:

if x != 5:
    if y < 4:
        statement
2
  • 8
    First you learn boolean logic. Commented Jul 24, 2011 at 19:45
  • I know it but my mind is so busy i couldn't find the solution to this simple question. sorry. Commented Jul 24, 2011 at 19:51

1 Answer 1

10
if x != 5 and y < 4:
  statement
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.