Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

TypeError: takes 0 positional arguments but 1 was given python

When Python tells you "generatecode() takes 0 positional arguments but 1 was
given", it's telling you that your method is set up to take no arguments, but
the self argument is still being passed when the method is called, so in fact
it is receiving one argument.

Adding self to your method definition should resolve the problem.
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #takes #positional #arguments #python
ADD COMMENT
Topic
Name
9+6 =