Jul 17, 2024
#
is a comment.is
and is not
are used for comparison.1 is 1
returns True
2 is 1
returns False
python is Python
returns False
due to case sensitivity2 + 3j
.complex
.True
and False
.type(True)
returns bool
type(False)
returns bool
True + True
returns 2
in
and not in
to check membership in sequences.'y' in 'Python'
returns True
'l' in 'Python'
returns False
~
), arithmetic (+
, -
, *
, /
, %
, //
), bitwise, comparison, identity, membership, logical operators.True
or False
list1 = [1, 2, 3]
list1.append(4)
list1.remove(2)
list1.pop(0)
list1.sort(reverse=True)