Skip to content

Instantly share code, notes, and snippets.

View sberke's full-sized avatar

Steven B sberke

View GitHub Profile
@fitzgeraldsteele
fitzgeraldsteele / net-promoter-score.py
Created November 7, 2013 21:13
A little python function to calculate the net promoter score from a list of ratings. Also wanted to practice doctests.
#!/usr/bin/env python
import sys
def netpromoterscore(scores):
"""
Calculates the netpromoter score of a list
The Net Promoter Score is obtained by asking customers a single question on a 0 to 10 rating scale:
'How likely is it that you would recommend our company to a friend or colleague?'
Based on their responses, customers are categorized into one of three groups:
Promoters (9-10 rating), Passives (7-8 rating), and Detractors (0-6 rating).