0
How to identify list element?
lst=[el1,el2,el3,el4] # How i can identify any type elements without indexing and slicing? Can i use if,else statement or loop for a list?
3 Answers
+ 3
You mean ?
For i in lst
If i=="el1":
Do something
Elif i=="el2":
Do.....
+ 1
Input=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
Create a list output of the prime numbers of the input list using loop, and if,else statements?
0
Try this
for i in lst:
do something ....