Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Question regarding lists

$
0
0
Can anyone tell me what is happening behind the scenes when these 2 are executed?:

listOne = [0 for i in range(100)]

listTwo = [0] * 100



I believe (correct me if i am wrong) in the first example it just loops 100 times and calls append(0) on the list.
No idea, how second one is executed.

Viewing all articles
Browse latest Browse all 51036

Trending Articles



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