Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
All Array Index
#3
(Feb-26-2021, 05:53 AM)buran Wrote:
spam = ['a', 'e', 'i', 'o', 'i', 'u']
for idx, char in enumerate(spam):
    print(f'{idx} --> {char}')
Output:
0 --> a 1 --> e 2 --> i 3 --> o 4 --> i 5 --> u
Now the question is do you really need the indexes.

Yes, I thank buran and within the context how do I access a certain value from within the array by idx?
Reply


Messages In This Thread
All Array Index - by JohnnyCoffee - Feb-26-2021, 05:45 AM
RE: All Array Index - by buran - Feb-26-2021, 05:53 AM
RE: All Array Index - by JohnnyCoffee - Feb-26-2021, 06:33 AM
RE: All Array Index - by ndc85430 - Feb-26-2021, 06:46 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  change array elements dependent on index SchroedingersLion 1 2,264 Nov-22-2019, 06:25 AM
Last Post: scidam

Forum Jump:

User Panel Messages

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