str1 = \'123\' str2 = \'\' print(str1.count(\'\')) # print 4 print(str2.count(\'\')) # print 1 list1 = [\'123\', \'123\'] list2 = [\'\', \'\'] print(list1.count(\'\'))