下面Python代码用于求1到N之和,N为正整数。因为 中为 ,因此是1到N且包含N之和。( )
N = int(input("请输入正整数:"))total = 0for i in range(1, N + 1):total += iprint(total)下面Python代码用于求1到N之和,N为正整数。因为 中为 ,因此是1到N且包含N之和。( )
N = int(input("请输入正整数:"))total = 0for i in range(1, N + 1):total += iprint(total)