Hello,
how can I count part of items in list?
to be clear :
I have a list that build in this form
Final_List= [['10.0.0.1:Success', '10.0.0.2:Success', '10.0.0.3:Error', '10.0.0.4:Offline' , '10.0.0.5:Error']]
I want to know how much Succes\error\offline there is in the list (i don't mind the IP - just the total number)
I have try to run
how can I count part of items in list?
to be clear :
I have a list that build in this form
Final_List= [['10.0.0.1:Success', '10.0.0.2:Success', '10.0.0.3:Error', '10.0.0.4:Offline' , '10.0.0.5:Error']]
I want to know how much Succes\error\offline there is in the list (i don't mind the IP - just the total number)
I have try to run
ok = 0 error = 0 offline = 0 for item in IP_List: if 'Success' in item: ok +=1 if 'Error' in item: error +=1 if 'offline' in item: offline += 1maybe I used list.appand wrong?
Final_List.append(p.map(GetUplaudFies, Device_List))GetUplaudFies return this
return ip + ":" + Upload_Status