Set Mutations

  • + 0 comments

    getattr function is used to do many stuff as you can take idea from its name (getattr ----->> get attribute ) this function can be used to use any function's attribute without prefixing that function name for eg. if we have to add item in the list how we genrally do

    lst = [] lst.append(4) <---------note this append(4) this attribute and other attribute of any fuction can be also written as

    getattr(lst, 'append')(4)

    i hope you got it 😊😉 haha