News for hackers. Stuff that matters.
Re:Python Cheat Sheet by TazeTSchnitzel on Tuesday September 04, 2012 @02:44PM (#4475914)
Looks like it exists, and works (at least for strings):

  >>> 'test'.count('e')
  1
  >>> 'test'.count('')
  5
  >>> 'test'.count('tes')
  1
  >>> 'test'.count('t')
  2
  >>> 'test'.count('apple')
  0
Seems to be the equivalent of `in` on a string but with a count.
Re:Python Cheat Sheet by nemetroid on Tuesday September 04, 2012 @03:10PM (#4476047)
It does exist for strings, but the list contains both `.count('string2')` and `.count(object1)`.
Re:Python Cheat Sheet by TazeTSchnitzel on Tuesday September 04, 2012 @03:13PM (#4476061)
It also works on lists, I think he got confused.