+ 1

while loop + list.insert

words = [] i= (len(words)) while i<=(i+2): words.insert(i, (i+1)) print(words) ''' the output is " time limit exceed" ---- https://code.sololearn.com/c37QV1M6Z0n8/?ref=app

3rd Jan 2018, 1:13 PM
amd
2 Answers
+ 8
https://code.sololearn.com/cQY47GU1F199/?ref=app the variable i was never incremented/updated in the loop. It remained as 0, therefore the while loop never ended.
3rd Jan 2018, 2:26 PM
jay
jay - avatar
+ 1
yes, it's thanks Jay
3rd Jan 2018, 2:46 PM
amd