Python Forum
When did the number got included in the list?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
When did the number got included in the list?
#15
I saw similar examples in https://www.programiz.com/python-programming/iterator
Generator are in curly brackets like a tuple but they are object that return a list.
I like the use you made of list (zip) much fater than while:

coordinate = []

y = 0
while y < 10:
    x = 0
    while x < 10:
        coordinate.append((x,y))
        x += 1
    coordinate.append((x,y))
    y += 1
    
for x in coordinate:
     print(x)
Thanks for the tips.
Reply


Messages In This Thread
RE: When did the number got included in the list? - by Frankduc - Feb-03-2022, 03:47 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Delete strings from a list to create a new only number list Dvdscot 8 1,600 May-01-2023, 09:06 PM
Last Post: deanhystad
  find random numbers that are = to the first 2 number of a list. Frankduc 23 3,324 Apr-05-2023, 07:36 PM
Last Post: Frankduc
  The included URLconf 'scribimus.urls' does not appear to have any patterns in it. nengkya 0 1,088 Mar-03-2023, 08:29 PM
Last Post: nengkya
  TypeError: float() argument must be a string or a number, not 'list' Anldra12 2 4,948 Jul-01-2022, 01:23 PM
Last Post: deanhystad
  Split a number to list and list sum must be number sunny9495 5 2,351 Apr-28-2022, 09:32 AM
Last Post: Dexty
  Divide a number by numbers in a list. Wallen 7 8,119 Feb-12-2022, 01:51 PM
Last Post: deanhystad
  Count number of occurrences of list items in list of tuples t4keheart 1 2,408 Nov-03-2020, 05:37 AM
Last Post: deanhystad
  How do I add a number to every item in a list? john316 2 2,009 Oct-28-2020, 05:29 PM
Last Post: deanhystad
  Print the number of items in a list on ubuntu terminal buttercup 2 1,965 Jul-24-2020, 01:46 PM
Last Post: ndc85430
  Make an array of string number in a List polantas 5 3,147 May-27-2020, 07:18 AM
Last Post: buran

Forum Jump:

User Panel Messages

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