similar: question: How to avoid pylint not-an-iterable when using a custom property class
I just started coding and didn't understand the code above
This code is working but I'm getting two warning errors in 2nd def
1,pylint(no-self-argument) (but i'm using it on class)
2,pylint(not-an-iterable) (on the customerlist in 2nd def)
class Customer:
def __init__(self, name, membership_type):
self.name = name
self.membership_type = membership_type
def print_all_customers(customerlist):
for customer in customerlist:
print(customer,'\n')
customerlist = [Customer('shagun','gold'),Customer('hero','diamond'),Customer('sid','gold')]
Customer.print_all_customers(customerlist)
how to avoid these errors in this code, please explain in simple words