fork download
  1.  
  2. searchString = "maki"
  3. itemList = ["Maki", "moki", "maki", "Muki", "Moki"]
  4.  
  5. resultList =[]
  6. matchCase = 0
  7.  
  8. if matchCase:
  9. resultList = [x for x in itemList if x == searchString]
  10. else:
  11. resultList = [x for x in itemList if x.lower() == searchString.lower()]
  12.  
  13.  
  14. print resultList
Success #stdin #stdout 0.01s 7692KB
stdin
Standard input is empty
stdout
['Maki', 'maki']