Error unidentified

def etoo(n):
for i in range(0,n):
for j in range (0,i + 1):
print (function(i,j)," “, end=”")
print ()
def etoo(n,k):
res = 1
if (k> n - k):
k = n - k
for i in range (0,k):
res = res * (n-1)
res = res//(n+i)
return res
etoo(7)

TypeError Traceback (most recent call last)
Cell In[19], line 14
12 res = res//(n+i)
13 return res
—> 14 etoo(7)

TypeError: etoo() missing 1 required positional argument: ‘k’

Click to add a cell.

First, your post is not correct. You should add text and format your code.
Then your problem has nothing to do with jupyter, but a pure python problem.

The problem is that you have the first definition of your function which is overwritten by the second. Indeed your function takes two arguments as input (n and k) and you only pass one argument (n).

2 Likes