In Python, the single equals sign (=) is the assignment operator used to create and assign a value to a variable, while the double equals sign (==) is a comparison operator that tests equality and does not perform assignment. To instantiate a list, you can either use the list() constructor (interfaces = list()) or assign a list literal enclosed in square brackets (interfaces = ["ge-0/0/0", "ge-10/0/1"]). Both of these use the assignment operator and correctly create a list object. Using == instead of = does not create or assign a list at all, so those options do not instantiate anything.
Community Discussion