Python Forum
print all method and property of list object
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
print all method and property of list object
#1
lst=[1,2,5]
d=dir(lst)#content all methon and properties

for i in d:
    print(lst.i)
if i run i have
AttributeError: 'list' object has no attribute 'i'
Reply


Messages In This Thread
print all method and property of list object - by engmoh - Oct-26-2019, 01:31 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How do you get Python to print just one value in a list? 357mag 3 1,034 May-17-2023, 09:52 PM
Last Post: rob101
  add object and name in list 3lnyn0 4 1,313 Nov-24-2022, 07:33 PM
Last Post: buran
  SystemError: <method-wrapper '__getattribute__' of EnumMeta object sciloop 4 1,522 Jul-23-2022, 07:57 PM
Last Post: sciloop
  AttributeError: 'list' object has no attribute 'upper' Anldra12 4 4,914 Apr-27-2022, 09:27 AM
Last Post: Anldra12
  Print List to Terminal DaveG 2 1,442 Apr-02-2022, 11:25 AM
Last Post: perfringo
  Subclass initialized property used in parent class method. Is it bad coding practice? saavedra29 5 1,804 Feb-07-2022, 07:29 PM
Last Post: saavedra29
  AttributeError: 'list' object has no attribute 'values' ilknurg 4 15,036 Jan-19-2022, 08:33 AM
Last Post: menator01
  Question about List.reverse() method tomliuwhite 1 1,360 Dec-07-2021, 08:20 AM
Last Post: ndc85430
  ABC Module and @property decorator, Pythonic Way? muzikman 21 5,703 Aug-18-2021, 06:08 PM
Last Post: muzikman
  @property vs __set__ / __get__ and __setattr__ / __getattr__ okhajut 1 3,346 Jun-15-2021, 03:48 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

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