Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threading and Queue
#2
If it is a list, it will print enclosed in brackets, to indicate to the viewer that is is indeed a list.
If you want to print the elements in a list, do:
mylist = ['apples', 'pears', 'oranges']
for item in mylist:
    print(item)
# to print individual items (remembering that the index is zero based)
[python]print(mylist[1])
will print pears.

[/python]
Reply


Messages In This Thread
Threading and Queue - by nexusfactor - Oct-16-2017, 02:34 AM
RE: Threading and Queue - by Larz60+ - Oct-16-2017, 04:31 AM
RE: Threading and Queue - by nexusfactor - Oct-16-2017, 12:21 PM
RE: Threading and Queue - by Larz60+ - Oct-16-2017, 03:52 PM
RE: Threading and Queue - by nexusfactor - Oct-16-2017, 04:04 PM
RE: Threading and Queue - by Larz60+ - Oct-16-2017, 04:14 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Concurrent futures threading running at same speed as non-threading billykid999 13 2,014 May-03-2023, 08:22 AM
Last Post: billykid999
  Tutorials on sockets, threading and multi-threading? muzikman 2 2,165 Oct-01-2021, 08:32 PM
Last Post: muzikman
  task queue Valon1981 8 3,669 Jul-07-2020, 07:41 AM
Last Post: freeman
  Queue in Pygame constantin01 1 3,731 Jan-07-2020, 04:02 PM
Last Post: metulburr
  Queue maxsize mr_byte31 2 4,606 Sep-03-2019, 07:02 PM
Last Post: mr_byte31
  Queue.Queue() would not reduce capacity after get() yuan8421 9 11,181 Jan-02-2018, 09:38 PM
Last Post: Windspar

Forum Jump:

User Panel Messages

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