thanks On Wednesday, October 28, 2020 at 5:07:13 PM UTC+5:30 [email protected] wrote:
> for i in grocery: > if i.store_type=="Alcohol" or "Both":(1) > This line checks if i.store_type is "Alcohol" or if the string "Both" is > Truthy - which it is because it is not '' or None - this if statement will > always be True. > > if i.store_type=="Alcohol" or i.store_type=="Both":(2) > This line checks if the i.store_type is 'Alcohol' or if the i.store_type > is 'Both'. This if statement will only be true if the store_type is > 'Alcohol' or 'Both'. > > Regards, > > Andréas > > Den ons 28 okt. 2020 kl 12:30 skrev Ashutosh Mishra <[email protected] > >: > >> for i in grocery: >> if i.store_type=="Alcohol" or "Both":(1) >> if i.store_type=="Alcohol" or i.store_type=="Both":(2) >> >> can anyone tell me the diffrence between two statements,I am getting two >> diffrent results >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/django-users/3d26d63e-e725-4074-bbd1-db05e87e402an%40googlegroups.com >> >> <https://groups.google.com/d/msgid/django-users/3d26d63e-e725-4074-bbd1-db05e87e402an%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/6a107a11-599d-42ca-9976-f6467cdc2701n%40googlegroups.com.

