Python Forum
need help in referencing a list
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
need help in referencing a list
#2
to print entire list:
for item in a:
    print(item)
To print last item:

print(a[-1])
Your item: a[a[-1]] would be:
Output:
a indexed by a[-1] = a[-2] = 1
Reply


Messages In This Thread
need help in referencing a list - by n00bdev - Nov-01-2020, 11:47 AM
RE: need help in referencing a list - by Larz60+ - Nov-01-2020, 11:59 AM
RE: need help in referencing a list - by buran - Nov-01-2020, 12:06 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  name 'lblstatus' is not defined when referencing a label KatManDEW 4 1,658 Apr-21-2022, 12:33 PM
Last Post: KatManDEW
  Dictionary Referencing nickdavis2017 1 1,664 Nov-20-2021, 06:24 PM
Last Post: deanhystad
  Referencing string names in df to outside variables illmattic 1 1,422 Nov-16-2021, 12:47 PM
Last Post: jefsummers
  Referencing a fixed cell Mark17 2 2,152 Dec-17-2020, 07:14 PM
Last Post: Mark17
  Issue referencing new instance from other class nanok66 3 2,308 Jul-31-2020, 02:07 AM
Last Post: nanok66
  referencing another method in a class Skaperen 6 2,781 Jul-02-2020, 04:30 AM
Last Post: Skaperen
  Theory behind referencing a dictionary rather than copying it to a list sShadowSerpent 2 2,158 Mar-24-2020, 07:18 PM
Last Post: sShadowSerpent
  "not defined" error in function referencing a class Exsul 2 3,757 Mar-27-2019, 11:59 PM
Last Post: Exsul
  Prevent Variable Referencing Th3Eye 4 2,977 Oct-03-2018, 07:01 PM
Last Post: buran
  Tree insertion and variable referencing hshivaraj 3 3,409 Dec-10-2017, 04:29 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