Python Forum
Arrange list of tuple using loop
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Arrange list of tuple using loop
#5
Hi,

did you work through the official Python tutorial at docs.python.org yet? That's always a good idea, as it is perfect to learn all the basics. And iterating is one of Python's basics, as iteration is used a lot in Python - and iteration is something Python is really powerful at.

Anyway, blueprint for you:

records = []
for item in nvm:
   record = {}
   record['event_id'] = item[0]
   #and so on
   records.append(record)
Regards, noisefloor
Reply


Messages In This Thread
Arrange list of tuple using loop - by batchenr - Jun-16-2019, 08:05 AM
RE: Arrange list of tuple using loop - by batchenr - Jun-16-2019, 10:27 AM
RE: Arrange list of tuple using loop - by DeaD_EyE - Jun-16-2019, 11:19 AM
RE: Arrange list of tuple using loop - by noisefloor - Jun-16-2019, 11:20 AM
RE: Arrange list of tuple using loop - by batchenr - Jun-16-2019, 02:37 PM
RE: Arrange list of tuple using loop - by Yoriz - Jun-16-2019, 03:03 PM
RE: Arrange list of tuple using loop - by Abdullah - Jun-16-2019, 03:24 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  using > < for tuple , list,... akbarza 3 560 Feb-05-2024, 01:18 PM
Last Post: deanhystad
Question mypy unable to analyse types of tuple elements in a list comprehension tomciodev 1 534 Oct-17-2023, 09:46 AM
Last Post: tomciodev
  Change font in a list or tuple apffal 4 2,779 Jun-16-2023, 02:55 AM
Last Post: schriftartenio
  search a list or tuple for a specific type ot class Skaperen 8 2,044 Jul-22-2022, 10:29 PM
Last Post: Skaperen
  why is my list a tuple CompleteNewb 7 2,343 Mar-17-2022, 10:09 PM
Last Post: CompleteNewb
  in a list or tuple Skaperen 6 107,279 May-16-2021, 09:59 PM
Last Post: Skaperen
  Create SQLite columns from a list or tuple? snakes 6 8,919 May-04-2021, 12:06 PM
Last Post: snakes
  What type of *data* is the name of a list/tuple/dict, etc? alloydog 9 4,532 Jan-30-2021, 07:11 AM
Last Post: alloydog
  code with no tuple gets : IndexError: tuple index out of range Aggam 4 2,938 Nov-04-2020, 11:26 AM
Last Post: Aggam
  Appending to list of list in For loop nico_mnbl 2 2,415 Sep-25-2020, 04:09 PM
Last Post: nico_mnbl

Forum Jump:

User Panel Messages

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