Answers for "if is"

0

if is

>>> a = [1, 2, 3]
>>> b = a
>>> b is a 
True
>>> b == a
True

# Make a new copy of list `a` via the slice operator, 
# and assign it to variable `b`
>>> b = a[:] 
>>> b is a
False
>>> b == a
True
Posted by: Guest on May-09-2022

Python Answers by Framework

Browse Popular Code Answers by Language