I Added A List To Itself In Python And This Happened

Liu Zuo Lin
Geek Culture
Published in
2 min readJan 30, 2022

--

This short article is a result of boredom, and doesn’t offer any useful knowledge. In Python, lists can contain any data type — integers, floats, strings, lists, dictionaries and so on.

list1 = [1, 3.14, "apple", True, [1,2], {"apple": "pie"}]

Curiosity led me to test if a list can contain itself:

list1 = [1, 2]…

--

--