0

I want my if statement to evaluate True if answers[3] == 'Friday' and if answers[4] equals either of '13-15' or '15-17'

Is below form correct?

if (answers[3] == 'Friday' and (answers[4] == '13-15' or answers[4] == '15-17')):
0

1 Answer 1

1

Yes it's correct, and you can use a set container in order to make the or statement more concise.

if answers[3] == 'Friday' and answers[4] in {'13-15', '15-17'}:
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.