Muhammad Ahmad
Muhammad Ahmad

Reputation: 19

Why do we use empty parentheses here in python reference to book data science from scratch?

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

Answers (1)

Tran Minh
Tran Minh

Reputation: 171

That means you want to create a list with no value inside. it is equivalent to user["friend"] = list()

Upvotes: 1

Related Questions