Python Forum
What type of *data* is the name of a list/tuple/dict, etc?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What type of *data* is the name of a list/tuple/dict, etc?
#3
device_list is just a list of character strings. So when you print one element of it, it's just the string that is printed.

device_list = ["device0", "device1", "device2", "device3 ", "device4", "device5", "device6", "device7", "device8", "device9", "device10", "device11 ", "device12", "device13", "device14"]
...
selected_device = (device_list[x])  # this will be a string like "device14"
print(selected_device) # And here it is printed out.
alloydog likes this post
Reply


Messages In This Thread
RE: What type of *data* is the name of a list/tuple/dict, etc? - by bowlofred - Jan-13-2021, 07:54 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Help with to check an Input list data with a data read from an external source sacharyya 3 506 Mar-09-2024, 12:33 PM
Last Post: Pedroski55
  using > < for tuple , list,... akbarza 3 532 Feb-05-2024, 01:18 PM
Last Post: deanhystad
Question mypy unable to analyse types of tuple elements in a list comprehension tomciodev 1 525 Oct-17-2023, 09:46 AM
Last Post: tomciodev
  Change font in a list or tuple apffal 4 2,757 Jun-16-2023, 02:55 AM
Last Post: schriftartenio
  search in dict inside tuple steg 1 735 Mar-29-2023, 01:15 PM
Last Post: rob101
  search a list or tuple for a specific type ot class Skaperen 8 2,022 Jul-22-2022, 10:29 PM
Last Post: Skaperen
  TypeError: unsupported operand type(s) for +: 'dict' and 'int' nick12341234 1 9,444 Jul-15-2022, 04:04 AM
Last Post: ndc85430
  Membership test for an element in a list that is a dict value for a particular key? Mark17 2 1,271 Jul-01-2022, 10:52 PM
Last Post: Pedroski55
  Are list/dict comprehensions interpreted really sequentially? anata2047 3 1,499 May-31-2022, 08:43 PM
Last Post: Gribouillis
  TypeError: unsupported opperand type(s) for %: 'int' and 'list' cool_person 7 2,280 May-07-2022, 08:40 AM
Last Post: ibreeden

Forum Jump:

User Panel Messages

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