Implement a function, so it will produce a sentence out of the given parts.

Array of parts could contain:
- words;
- commas in the middle;
- multiple periods at the end.

Sentence making rules:
- there must always be a space between words;
- there must not be a space between a comma and word on the left;
- there must always be one and only one period at the end of a sentence.

**Example:**

Source: codewars | Difficulty: EASY
Tags: String algorithms

Fundamentals

Starter code: def make_sentences(parts):
	

Solutions:
def make_sentences(parts):
	return ' '.join(parts).replace(' ,', ',').strip(' .') + '.'


import re

def make_sentences(parts):
	return re.sub(' ([,.])', '\\1', ' '.join(parts).replace(' ,', ',')).rstrip('.') + '.'


import re

def make_sentences(parts):
	return re.match('[^\\.]+', ' '.join(parts).replace(' , ', ', ')).group().strip() + '.'


def make_sentences(parts):
	result = ''
	for i in range(len(parts) - 1):
		result += parts[i]
		if parts[i + 1] not in '.,':
			result += ' '
	result += parts[-1]
	return result.rstrip('.') + '.'


def make_sentences(parts):
	return ' '.join((x for x in parts if x != '.')).replace(' ,', ',') + '.'


def make_sentences(parts):
	return ' '.join(parts).replace(' ,', ',').rstrip(' .') + '.'


def make_sentences(parts):
	import re
	sentence = re.sub('\\b ([.,])', '\\1', ' '.join(parts)).rstrip('. ')
	return sentence + '.'


def make_sentences(parts):
	return '{}.'.format(''.join((' ' + a if a.isalnum() else a for a in parts)).strip(' .'))


def make_sentences(parts):
	n = ''
	parts = [i for i in parts if i != '.']
	for i in parts:
		if i == ',':
			n = n[:-1] + ', '
		else:
			n += i + ' '
	return n[:-1] + '.'