I just came over a python program asking for output. The code was :
l=[]*100
for i in range (100):
l.append(i+1)
flag=0
k=108
for i in range(100):
if(k==l[i]):
print("Element is present at position",i)
flag=1
break
if(flag==0):
print("Element is not present in the given list")
My question is what does the list l=[]*100 do?
Besides when I am executing this code the answer I get is : "Element is not present in the given list". But the answer given is 100 which I think is not possible. Someone please help