# Basic Doubt in syntax

**URL:** <https://discuss.python.org/t/basic-doubt-in-syntax/9789>\
**Category:** Python Help\
**Created:** [July 21, 2021, 11:21am UTC](https://discuss.python.org/t/basic-doubt-in-syntax/9789 "2021-07-21T11:21:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cr7-afk](https://avatars.discourse-cdn.com/v4/letter/c/76d3ee/32.png) [@cr7-afk](https://discuss.python.org/u/cr7-afk)\
**Post date:** [July 21, 2021, 11:21am UTC](https://discuss.python.org/t/basic-doubt-in-syntax/9789/1 "2021-07-21T11:21:27Z")

</div>

Can anyone tell what is the difference between following two code?

if i == 7 or 10

if i == 7 or i ==10

---

<div class="post-metadata">

**Author:** ![Mholscher](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/mholscher/32/15325_2.png) [@Mholscher](https://discuss.python.org/u/Mholscher)\
**Post date:** [July 21, 2021, 12:00pm UTC](https://discuss.python.org/t/basic-doubt-in-syntax/9789/2 "2021-07-21T12:00:33Z")

</div>

The first will always return true. It is evaluated as:  
if (i == 7) or 10  
… and 10 is evaluated to True in Python.

The second one will only evaluate to True if i equals 7 or i equals 10, which is probably what you need.

---

<div class="post-metadata">

**Author:** ![cr7-afk](https://avatars.discourse-cdn.com/v4/letter/c/76d3ee/32.png) [@cr7-afk](https://discuss.python.org/u/cr7-afk)\
**Post date:** [July 21, 2021, 3:08pm UTC](https://discuss.python.org/t/basic-doubt-in-syntax/9789/3 "2021-07-21T15:08:01Z")

</div>

thankyou so much man I know it was silly but was little confused
