This question already has an answer here:
- How does Python compare string and int? 2 answers
I have python list fin_list as follows:
['1', '15']
['3', '5', '1']
['140', '147', '141']
['133', '137', '134']
['10', '12', '11']
['12', '16', '15']
['9', '10', '112576569']
['8', '9', '10']
['7', '8']
['15', '16', '9', '133889916']
['1', '3', '74228172']
['3', '5', '1']
['5', '6']
and I want to remove all the lists having large numbers like 112576569, 133889916 and 74228172. Hence I am putting a condition in my code as :
if(all(i<=1000 for i in fin_list)):
print fin_list
However when I put this condition , I get no output but when I put the condition, i>=1000 , all the lists show up in the output. Any help in understanding as to why would that happen , will be useful.
Aucun commentaire:
Enregistrer un commentaire