So I have changeable sized list with integers in it like [2,5,6,9,1] and I am trying to create an addition formula with for loop:
(所以我有一个可变大小的列表,其中包含整数,例如[2,5,6,9,1],并且我试图用for循环创建一个加法公式:)
z= 1
while z > 0:
for i in range(len(list)):
print(list[i],"+", end=" ")
z = 0
print("=",sum(list),end=" ")
This is what i am trying and output is:
(这是我正在尝试的输出是:)
2 + 5 + 6 + 9 + 1 + = 23
What should I do if I want to output n integers and n-1 plus signs between integers?
(如果要输出n个整数和n-1加整数之间的符号,该怎么办?)
ask by user19281 translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…