how this is working? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

how this is working?

a = [i for i in range(20)] b = [i for i in range(0,20)] c = len(a) - len(b) for i in b[:]: c *= i print (c)

7th Sep 2020, 4:20 PM
#challenger mg
#challenger mg - avatar
6 Answers
+ 9
#challenger please don't be rude, Vadivelan is trying to help you, be thankful instead. Anyway that's list comprehension in python https://code.sololearn.com/c1eB8UTw29bb/?ref=app
7th Sep 2020, 4:32 PM
Rohit
+ 6
⚠️Respect Community members!⚠️ a=[0, 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19] b=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19] c=len(a)-len(b) #20-20=0 In for loop All elements of b is multiply with c So output will be 20 times 0.
7th Sep 2020, 4:34 PM
Vadivelan
+ 3
Try on Code playground!. Also mention your expected output!. Mention the language as tag.
7th Sep 2020, 4:22 PM
Vadivelan
0
Sry if ur thinking that i behaved rudely
8th Sep 2020, 12:23 AM
#challenger mg
#challenger mg - avatar
0
Sry to community members if they felt so ...btw I just wat to make sure that I would get amswers only not guidelines nd all rules..🙏
8th Sep 2020, 12:26 AM
#challenger mg
#challenger mg - avatar
- 5
if u know answer then contact me:otherwise get out of this
7th Sep 2020, 4:24 PM
#challenger mg
#challenger mg - avatar