我编写了这段代码,但是我想将输入内容放在一行中。我尝试使用map(int,input()。split())但我想进入(m + 1)的范围并且不知道如何添加
import numpy as np
from numpy import poly1d
m = int(input())
n = int(input())
y = []
if n >= 1 and m <= 20:
for j in range(m + 1):
c = int(input())
y.append(c)
p1: poly1d = np.poly1d(y)
p2 = p1 ** n
o = p2.coef
print(*o, sep=" ")
通过使用print的end arg进行尝试: