Your dad doesn't really *get* punctuation, and he's always putting extra commas in when he posts. You can tolerate the run-on sentences, as he does actually talk like that, but those extra commas have to go!

Write a function called ```dadFilter``` that takes a string as argument and returns a string with the extraneous commas removed. The returned string should not end with a comma or any trailing whitespace.

Difficulty: introductory

Starter code:

def dad_filter(string):
	

Solutions:
from re import compile, sub

REGEX = compile(r',+')


def dad_filter(strng):
    return sub(REGEX, ',', strng).rstrip(' ,')


import re
def dad_filter(string):
    return re.sub(r',+',r',',string).rstrip(', ')

import re
def dad_filter(string):
    return re.sub(r'((?<=\,)\,+|[\s,]+\Z)','',string)

import re


def dad_filter(string):
    return re.sub(r',* *$', '', re.sub(r',{2,}', ',', string))

def dad_filter(string):
    return ",".join([w for w in string.rstrip(", ").split(",") if w != ""])

def dad_filter(string):
    return ','.join([el for el in string.split(',') if el]).rstrip(", ")

import re
dad_filter = lambda s: re.sub(r',+',',',s).strip(', ')

import re

def dad_filter(s):
    return re.sub(',+', ',', s.rstrip(', '))

import re

def dad_filter(string):
    string = re.sub(r',+', ',', string.strip())
    if string[-1] == ',':
        return string[:-1]
    else:
        return string

def dad_filter(string):
    #your code here
    new_list = string.split()
    for i in range(len(new_list)):
        while new_list[i].count(',') > 1:
            new_list[i] = new_list[i].replace(',', '', 1)
    
    str = ' '.join(new_list)       
    while str[-1] in ' ,':
        str = str[:-1]
    return str