0

Can you use not instead of != ?

In Python

15th Aug 2023, 8:14 AM
Muhammad Hassan Abbas
Muhammad Hassan Abbas - avatar
3 Answers
+ 5
It depends on the circumstance. `!=` is better for comparing values whilst `is not` is better for comparing object locations. Check this out for more details: https://www.tutorialspoint.com/difference-between-and-is-not-operator-in-JUMP_LINK__&&__python__&&__JUMP_LINK
15th Aug 2023, 8:21 AM
Justice
Justice - avatar
+ 4
Fun zone , maybe you can share your code or a snippet as sample for us?
15th Aug 2023, 2:43 PM
Lothar
Lothar - avatar
+ 1
ŠŠµŃ‚, Š½ŠµŠ»ŃŒŠ·Ń ŠøсŠæŠ¾Š»ŃŒŠ·Š¾Š²Š°Ń‚ŃŒ not Š²Š¼ŠµŃŃ‚Š¾ != , ŠµŠ³Š¾ Š½ŃƒŠ¶Š½Š¾ ŠøсŠæŠ¾Š»ŃŒŠ·Š¾Š²Š°Ń‚ŃŒ Š“Š»Ń boolean Š·Š½Š°Ń‡ŠµŠ½ŠøŠ¹, Š“Š¾ŠæустŠøŠ¼, not True(False) not False(True) .
15th Aug 2023, 8:44 PM
Programmer I = "Junior";