easy5 pts · first answer countspythonpython-basics
is versus == for two lists
What do the two comparisons print?
a = [1, 2] b = [1, 2] print(a == b, a is b)
Discussion 0
Join free to post in the discussion.
Related questions
- Changing an item in a tupleData Scientist
- Reading a missing dictionary key safelyData Scientist
- List comprehension with a conditionData Scientist
- Slicing part of a stringData Scientist
- Floor division with a negative numberData Scientist
- Checking 0.1 + 0.2 == 0.3Data Scientist
- Formatting a price with an f-stringData Scientist
- Why use with open()Data Scientist