Challenge: Reference Fixer
Swipe to start coding
Complete the function so that you add an item only to the target_list without affecting other_list. Sometimes, both lists may refer to the same underlying object, so be careful to avoid unwanted side effects.
- Check if
target_listandother_listrefer to the same object. - If they do, create a new list for
target_listthat contains the same elements as before. - Add
itemtotarget_list. - Print both lists using these templates:
"Target list: {target_list}""Other list: {other_list}"
Рішення
Дякуємо за ваш відгук!
single
Запитати АІ
Запитати АІ
Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат
Can you explain this in simpler terms?
What are some examples related to this topic?
Where can I learn more about this?
Awesome!
Completion rate improved to 5.26
Challenge: Reference Fixer
Свайпніть щоб показати меню
Swipe to start coding
Complete the function so that you add an item only to the target_list without affecting other_list. Sometimes, both lists may refer to the same underlying object, so be careful to avoid unwanted side effects.
- Check if
target_listandother_listrefer to the same object. - If they do, create a new list for
target_listthat contains the same elements as before. - Add
itemtotarget_list. - Print both lists using these templates:
"Target list: {target_list}""Other list: {other_list}"
Рішення
Дякуємо за ваш відгук!
single