0
我的代碼如下:如何在同一時間迭代兩個變量?
startDates = ['2011-01-01','2012-01-01']
endDates = ['2013-01-01','2014-01-01']
theJuice = []
for startDate in startDates and endDate in endDates:
start_date = startDate
end_date = endDate
print start_date
print end_date
我希望你能幫助我。
閱讀文檔的內置'拉鍊()'函數。 –
你想要startDate和endDate的每個組合嗎?也就是說,你想要2次迭代還是4次? –