Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

TypeError: method() takes 1 positional argument but 2 were given

# Employee Class
class Employee:
    # Get Employee method with self parameter
    def GetEmployeeID(self,name):
        print(f"The Employee ID of {name} ", 1234)

# instance of the employee
empObj = Employee()
empObj.GetEmployeeID("Chandler Bing")
Source by itsmycode.com #
 
PREVIOUS NEXT
Tagged: #takes #positional #argument
ADD COMMENT
Topic
Name
6+2 =