<div>
</div>
<p>我们应该做的任务是看一个列表,如</p>
<pre><code>[3884, 2888, 2752, 3916, 1479, 2455]
</code></pre>
<p>这些数字表示条形码。
然后给出了列表中要查看的部分的两个参数</p>
<p>例如,参数是<code>(list,1,3)</code>。其中1和3是我们需要使用的列表的一部分。然后我们必须找到列表中每个部分的总和。我们需要能够输出<code>[26,16, 19]</code>。最后一部分是查找最大编号并返回原始条形码。为此,我计划使用<code>if & elif</code>语句,因为<code>max</code>是不允许的。我需要帮助找到列表中每个部分的总和</p>
<pre><code>def freshFruit (barcodes, startIndex, stopIndex):
barcodesTested= barcodes[startIndex:int(stopIndex)+1:])# +1 make it inclusive
print (barcodesTested)
numberInList = len(barcodesTested)
print(numberInList)
x=0
for x in range(len(barecodesTested)):#i was thinking of find each sum individually
for barecodesTested[x] in:
</code></pre>