Python Forum
making list in looping a dictionary
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
making list in looping a dictionary
#9
(Jun-25-2020, 12:55 PM)deanhystad Wrote: Do you want a list of the dictionary keys, or do you want a list that contains the dictionary as a list? Should the end result look like this:

["glenn","elena","mama"]

or this:

[["glenn",1], ["elena", 2], ["mama",3]]

or something else?

i want something like this:
glenn=[ ]
elena=[ ]
mama=[ ]
is this possible using for loop in a dictionary or i have to use def ?
coz i dont want to declare those list, i want those list to be created on a for loop or in a def function if possible
Reply


Messages In This Thread
RE: making list in looping a dictionary - by glennford49 - Jun-25-2020, 02:32 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Sort a list of dictionaries by the only dictionary key Calab 2 1,567 Apr-29-2024, 04:38 PM
Last Post: Calab
  Dictionary in a list bashage 2 1,524 Dec-27-2023, 04:04 PM
Last Post: deanhystad
  filtering a list of dictionary as per given criteria jss 5 1,947 Dec-23-2023, 08:47 AM
Last Post: Gribouillis
  for loops break when I call the list I'm looping through Radical 4 2,105 Sep-18-2023, 07:52 AM
Last Post: buran
  How to add list to dictionary? Kull_Khan 3 1,934 Apr-04-2023, 08:35 AM
Last Post: ClaytonMorrison
  check if element is in a list in a dictionary value ambrozote 4 4,089 May-11-2022, 06:05 PM
Last Post: deanhystad
  Dictionary from a list failed, help needed leoahum 7 3,450 Apr-28-2022, 06:59 AM
Last Post: buran
  how to assign items from a list to a dictionary CompleteNewb 3 2,838 Mar-19-2022, 01:25 AM
Last Post: deanhystad
  Python, how to manage multiple data in list or dictionary with calculations and FIFO Mikeardy 8 4,528 Dec-31-2021, 07:47 AM
Last Post: Mikeardy
  Class-Aggregation and creating a list/dictionary IoannisDem 1 2,825 Oct-03-2021, 05:16 PM
Last Post: Yoriz

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020