Quantcast
Channel: Active questions tagged crash - Stack Overflow
Viewing all articles
Browse latest Browse all 7193

Is there any method to stop python program from crashing?

$
0
0

Below is a normal program in which I am trying to take odd index numbers from listOne and even index number from listTwo and then appending those numbers in listThree, but every tome I run it in a jupyter notebook my laptop freezes and I have to force shutdown it, please help me to understand what is wrong with the code, why it crashes every time??

listOne=[3,6,9,12,15,18,21]listTwo=[4,8,12,16,20,24,28]listThree=[][listThree.append(i) for i in listOne if i%2!=0][listTwo.append(i) for i in listTwo if i%2==0]print(listThree) 

Viewing all articles
Browse latest Browse all 7193

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>