This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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). |