Skip to content
Advertisement

TypeError: __init__() missing 2 required positional arguments: ‘arr’ and ‘n’

This is a problem of the missing number in python.

JavaScript

I am getting this error. can anybody solve it?

JavaScript

Advertisement

Answer

you need put the input outside class,and assign it when you create instance by Obj = Missing(arr,n)

code:

JavaScript

result:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement