Merge pull request #709 from Tasnimsomo/patch-1

Update 03_operators.md
This commit is contained in:
Asabeneh 2026-01-10 19:15:27 +02:00 committed by GitHub
commit 37e39b9589
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -214,13 +214,13 @@ In addition to the above comparison operator Python uses:
- _is_: Returns true if both variables are the same object(x is y)
- _is not_: Returns true if both variables are not the same object(x is not y)
- _in_: Returns True if the queried list contains a certain item(x in y)
- _not in_: Returns True if the queried list doesn't have a certain item(x in y)
- _not in_: Returns True if the queried list doesn't have a certain item(x not in y)
```py
print('1 is 1', 1 is 1) # True - because the data values are the same
print('1 is not 2', 1 is not 2) # True - because 1 is not 2
print('A in Asabeneh', 'A' in 'Asabeneh') # True - A found in the string
print('B in Asabeneh', 'B' in 'Asabeneh') # False - there is no uppercase B
print('B not in Asabeneh', 'B' in 'Asabeneh') # False - there is no uppercase B
print('coding' in 'coding for all') # True - because coding for all has the word coding
print('a in an:', 'a' in 'an') # True
print('4 is 2 ** 2:', 4 is 2 ** 2) # True