Answer the question
In order to leave comments, you need to log in
How to remove commas in an answer?
Hello, I have this code:
n = 5
k = 3
def genkinv(n, k):
a = []
while n > 0:
if k > n - 1:
a.append(n)
k -= (n - 1)
n -= 1
else:
for i in range(1, n - k):
a.append(i)
a.append(n)
for i in range(n - k, n):
a.append(i)
k = 0
n = 0
return a print (
genkinv
(n,k))
how to change the code so that the answer is not separated by commas, but by a space?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question