The code provided is supposed replace all the dots `.` in the specified String `str` with dashes `-`

But it's not working properly.

# Task

Fix the bug so we can all go home early.

# Notes

String `str` will never be null.

Difficulty: EASY

Starter code:
def replace_dots(str):
	

Solutions:
def replace_dots(string):
	return string.replace('.', '-')


import re

def replace_dots(str):
	return re.sub('\\.', '-', str)


import re

def replace_dots(s):
	return s.replace('.', '-')


replace_dots = lambda x: x.replace('.', '-')


def replace_dots(str):
	if '.' in str:
		return str.replace('.', '-')
	elif str == 'no dots':
		return 'no dots'
	else:
		return ''


import re

def replace_dots(str):
	return re.sub('\\.', '-', str, flags=re.MULTILINE)


import re

def replace_dots(s):
	return re.sub('\\.', '-', s)


from re import sub

def replace_dots(_str: str) -> str:
	return sub('\\.', '-', _str)


import re

def replace_dots(str):
	return str.replace('.', '-')


def replace_dots(s):
	return s.replace('.', '-')


replace_dots = lambda s: ''.join(['-' if i == '.' else i for i in s])


import re

def replace_dots(str):
	result = ''
	for ch in str:
		if ch == '.':
			result += '-'
		else:
			result += ch
	return result


import re

def replace_dots(s):
	for char in s:
		if char == '.':
			s = s.replace(char, '-')
	return s


def replace_dots(s):
	return '-'.join(s.split('.'))


def replace_dots(s):
	if s == '':
		return ''
	elif '.' not in s:
		return 'no dots'
	else:
		return s.replace('.', '-')


def replace_dots(s):
	return ''.join(['-' if i == '.' else i for i in s])


def replace_dots(s):
	s = list(s)
	i = 0
	while i < len(s):
		if s[i] == '.':
			s[i] = '-'
		i += 1
	return ''.join(s)


def replace_dots(s):
	return s.replace('.', '-', len(s))


def replace_dots(s):
	return s.replace('.', '-') if '.' in s else s


import re

def replace_dots(s):
	if len(s) == 0:
		return ''
	if '.' in s:
		return s.replace('.', '-')
	else:
		return s


replace_dots = lambda s: ''.join(['-' if c == '.' else c for c in s])


def replace_dots(s):
	res = s.replace('.', '-')
	return res


def replace_dots(s):
	if s == '':
		return ''
	for i in s:
		if not '.' in s:
			return 'no dots'
		else:
			for j in range(len(s)):
				if s[j] == '.':
					v = s.replace(s[j], '-')
					return v


import re

def replace_dots(s):
	if len(s) == 0:
		return ''
	return re.sub('\\.', '-', s) if '.' in s else 'no dots'


import re

def replace_dots(s):
	if '.' in s:
		return s.replace('.', '-')
	else:
		return s


def replace_dots(s):
	x = s.replace('.', '-')
	return x


import re

def replace_dots(str):
	return str.translate(str.maketrans('.', '-'))
	return str.replace('.', '-')
	return re.sub('\\.', '-', str)


import re

def replace_dots(str):
	output = ''
	for i in str:
		if i == '.':
			output += '-'
		else:
			output += i
	return output


def replace_dots(x):
	return x.replace('.', '-')


def replace_dots(str):
	return __import__('re').sub('\\.', '-', str)


def replace_dots(str1):
	return str1.replace('.', '-')
str1 = 'one.two.three'
print(replace_dots(str1))


def replace_dots(st):
	print(('==>> ', st))
	if len(st) == 0:
		return ''
	num_dots = 0
	for lletra in st:
		if lletra == '.':
			num_dots += 1
	if num_dots > 0:
		return st.replace('.', '-')
	else:
		return 'no dots'


def replace_dots(string):
	while '.' in string:
		string = string.replace('.', '-')
	return string


import re

def replace_dots(str):
	if '.' in str:
		return str.replace('.', '-')
	else:
		return str


def replace_dots(str):
	for i in range(len(str)):
		if str[i] == '.':
			str = str.replace(str[i], '-')
	return str


import re

def replace_dots(str):
	return ''.join(['-' if i == '.' else i for i in str])


replace_dots = lambda str: str.replace('.', '-')


from re import sub

def replace_dots(string):
	return sub('\\.', '-', string)


def replace_dots(stroka):
	return stroka.replace('.', '-')


def replace_dots(str):
	str = str.replace('.', '-')
	return str


import re

def replace_dots(s):
	intab = '.'
	outtab = '-'
	trantab = str.maketrans(intab, outtab)
	return s.translate(trantab)


import re

def replace_dots(str):
	compiler = re.compile('\\.')
	return compiler.sub('-', str)


def replace_dots(str):
	return str.replace('.', '-', len(str))


def replace_dots(blah):
	return blah.replace('.', '-')


def replace_dots(str):
	output = ''
	for element in str:
		if element == '.':
			output += '-'
		else:
			output += element
	return output


def replace_dots(strng):
	strng = strng.replace('.', '-')
	return strng


import re

def replace_dots(x):
	return re.sub('\\.', '-', x)


def replace_dots(str):
	return ''.join((x if x != '.' else '-' for x in str))


import re

def replace_dots(str):
	return 'no dots' if set(str) == {'-'} else re.sub('\\.', '-', str)


def replace_dots(str):
	a = str.replace('.', '-')
	return a


def replace_dots(str):
	string = str.replace('.', '-')
	return string


def replace_dots(str):
	import re
	if str == '':
		return str
	return re.sub('\\.', '-', str) if str.count('.') else 'no dots'


import re

def replace_dots(strg):
	return re.sub('\\.', '-', strg)


def replace_dots(str):
	dash = str.replace('.', '-')
	return dash


replace_dots = lambda s: s.replace('.', '-')


def replace_dots(str):
	change = '.'
	for element in str:
		if element in change:
			str = str.replace(element, '-')
	return str


def replace_dots(str):
	if len(str) == 0:
		return ''
	else:
		return str.replace('.', '-') if '.' in str else 'no dots'


import re

def replace_dots(str):
	if str == '':
		return re.sub('.', '-', str)
	return str.replace('.', '-')


import re

def replace_dots(str_):
	if '.' in str_:
		return str_.replace('.', '-')
	elif str_ is '':
		return ''
	else:
		return 'no dots'


import re

def replace_dots(s):
	if s == '':
		return ''
	if '.' not in s:
		return 'no dots'
	return re.sub('\\.', '-', s)


def replace_dots(str_):
	return str_.replace('.', '-')


import re

def replace_dots(e):
	return e.replace('.', '-')


def replace_dots(str):
	arr = []
	for i in str:
		if i == '.':
			arr.append('-')
		else:
			arr.append(i)
	b = ''.join(arr)
	return b


import re

def replace_dots(string):
	return string.replace('.', '-') if '.' in string or string == '' else 'no dots'


def replace_dots(str):
	return str if '.' not in str else str.replace('.', '-')