Same or Equal?
Python
20 pts
Same or Equal?
Three variables are given. list3 is not a copy — it is another name for list1.
Create four booleans:
same_values— whetherlist1andlist2have equal values (==).same_object— whetherlist1andlist2are the same object (is).alias— whetherlist3andlist1are the same object.keren_missing— whether"Keren"is not inlist2.
Print them in that order. Expected output:
True False True False
Checklist
- Keep the three given lines and create
same_values: whetherlist1andlist2have equal values. - Create
same_object: whetherlist1andlist2are the same object. - Create
alias: whetherlist3andlist1are the same object. - Create
keren_missing: whether"Keren"is not inlist2. - Print the four booleans, one per line.
🔑 Solution
If you view the solution before passing, you earn half points for this exercise. You still need to type it and press Check to finish.
How it works, step by step
Point at a step to highlight its lines. Type the solution yourself and press Check answer to finish.
