def counter_format(counter):
    """ Pretty print a counter so that it appears as: "2:200,3:100,4:20"
    """
    if not counter:
        return "na"

    return ",".join("{}:{}".format(*z) for z in sorted(counter.items()))
Pretty print a counter so that it appears as: "2:200,3:100,4:20"