We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
For the sum_two_challenge notebook (link), the Solution class template only takes one parameter:
class Solution(object): def sum_two(self, val): # TODO: Implement me pass
That should change to two parameters:
class Solution(object): def sum_two(self, a, b): # TODO: Implement me pass
Otherwise a TypeError is raised with the message:
TypeError: sum_two() takes 2 positional arguments but 3 were given
The text was updated successfully, but these errors were encountered:
Hey Mark, We can still solve this by using the variable argument syntax in the sum_two method
class Solution(object): def sum_two(self, *val): return sum(val)
Run the test cases and it will pass all of them. Appreciate any feedback from your side.
Sorry, something went wrong.
For the sum_two_challenge notebook (link), the Solution class template only takes one parameter: class Solution(object): def sum_two(self, val): # TODO: Implement me pass That should change to two parameters: class Solution(object): def sum_two(self, a, b): # TODO: Implement me pass Otherwise a TypeError is raised with the message: TypeError: sum_two() takes 2 positional arguments but 3 were given
def sum_two(self, *val): return val
you can enter multiple values when we use (*args) and (**kwargs) takes keywords arguments
No branches or pull requests
For the sum_two_challenge notebook (link), the Solution class template only takes one parameter:
That should change to two parameters:
Otherwise a TypeError is raised with the message:
TypeError: sum_two() takes 2 positional arguments but 3 were given
The text was updated successfully, but these errors were encountered: