生成特定数列 7.6
Python
n = int(input("请输入N: "))
print("前", n, "个自然数是:")
for i in range(1, n+1): # 注意:n+1
print(i, end=' ')