Menu

itemPercentage()

Version 1.0 and Later

Usage

itemPercentage(listobject, item)
  • Returns percentage of listobject that is made up on item.
  • listobject must be a list.
  • item can be any object type containable within a list.

Examples

>>> from pydoodles import itemPercentage
>>> mylist = [1, 2, 3, 4, 5, 6, 7, 7, 9, 10]
>>> itempercentage(mylist, 1)
10.0
>>> itempercentage(mylist, 7)
20.0

Related

Blog: 2013/04/10-progress-report

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.