Reputation: 19
Why do we use empty parentheses here in python?
My code is reference to book Data Science from scratch.
for user in users: user["friend"]=[]
In the above code Users is a list in which there are some dictionaries.
Upvotes: 0
Views: 40
Reputation: 171
That means you want to create a list with no value inside.
it is equivalent to user["friend"] = list()
Upvotes: 1