List with many dictionaries VS dictionary with few lists?

后端 未结 6 2227
你的背包
你的背包 2020-12-29 02:40

I am doing some exercises with datasets like so:

List with many dictionaries

users = [
    {\"id\": 0, \"name\": \"Ashley\"},
    {\         


        
6条回答
  •  一生所求
    2020-12-29 03:31

    users in general sense is actually a collection of user elements. So it's better to define the user element as a standalone entity. So your first option is the right one.

提交回复
热议问题