如果我有6的索引位置,我只想得到第一句话:Dana's places, we're having people coming to us people wanna buy condos.如果我有80的索引位置,我只想得到第二句话:They want to move quickly and we're just losing out on a lot of great places.
list with 3 integersfor i, n in enumerate(a):print(sub)10相反,我得到一个错误,即列表索引超出了范围。我知道为什么要这样做:因为当i点击2时,i+1变成3,列表中没有a[3]元素。然而,对于如此简单的事情,我似乎不知道如何获得这样的连续索引,特别是对于一个我不知道元素数量的列表。
我怎么才能解决这个问题?