When a warrior wants to talk with another one about peace or war he uses a smartphone.  In one distinct  country warriors who spent all time in training kata not always have enough money. So if they call some number they want to know which operator serves  this number. 

Write a function which **accepts number and return name of operator or string "no info"**, if operator can't be defined. number always looks like 8yyyxxxxxxx, where yyy corresponds to operator.

Here is short list of operators:

* 039 xxx xx xx - Golden Telecom
* 050 xxx xx xx - MTS
* 063 xxx xx xx - Life:)
* 066 xxx xx xx - MTS
* 067 xxx xx xx - Kyivstar
* 068 xxx xx xx - Beeline
* 093 xxx xx xx - Life:)
* 095 xxx xx xx - MTS
* 096 xxx xx xx - Kyivstar
* 097 xxx xx xx - Kyivstar
* 098 xxx xx xx - Kyivstar
* 099 xxx xx xx - MTS Test [Just return "MTS"]

Source: codewars | Difficulty: EASY
Tags: Fundamentals

Starter code: def detect_operator(num):
	

Solutions:
OPERATORS = {'039': 'Golden Telecom', '050': 'MTS', '063': 'Life:)', '066': 'MTS', '067': 'Kyivstar', '068': 'Beeline', '093': 'Life:)', '095': 'MTS', '096': 'Kyivstar', '097': 'Kyivstar', '098': 'Kyivstar', '099': 'MTS'}

def detect_operator(num):
	return OPERATORS.get(str(num)[1:4], 'no info')


OPERATORS = {'039': 'Goldem Telecom', '050': 'MTS', '063': 'Life:)', '066': 'MTS', '067': 'Kyivstar', '068': 'Beeline', '093': 'Life:)', '095': 'MTS', '096': 'Kyivstar', '097': 'Kyivstar', '098': 'Kyivstar', '099': 'MTS'}

def detect_operator(num):
	try:
		code = str(num)[1:4]
		return OPERATORS[code]
	except KeyError:
		return 'no info'


import re

def detect_operator(num):
	d = {'0(66|50|9[59])': 'MTS', '0[69]3': 'Life:)', '0(9[6-8]|67)': 'Kyivstar', '068': 'Beeline', '039': 'Golden Telecom'}
	for temp in d:
		if re.fullmatch(temp, num[1:4]):
			return d[temp]
	return 'no info'


def detect_operator(num):
	d = {'Golden Telecom': ['039'], 'MTS': ['050', '066', '095', '099'], 'Life:)': ['063', '093'], 'Kyivstar': ['067', '096', '097', '098'], 'Beeline': ['068']}
	return next((k for k in d if num[1:4] in d[k]), 'no info')


r = dict(__import__('re').findall('(\\d{3}).*-\\s(.+)', '\n        039 xxx xx xx - Golden Telecom\n        050 xxx xx xx - MTS\n        063 xxx xx xx - Life:)\n        066 xxx xx xx - MTS\n        067 xxx xx xx - Kyivstar\n        068 xxx xx xx - Beeline\n        093 xxx xx xx - Life:)\n        095 xxx xx xx - MTS\n        096 xxx xx xx - Kyivstar\n        097 xxx xx xx - Kyivstar\n        098 xxx xx xx - Kyivstar\n        099 xxx xx xx - MTS\n        '))
detect_operator = lambda s: r.get(s[1:4], 'no info')


import re

def detect_operator(num):
	s = '    \n    039 xxx xx xx - Golden Telecom\n    050 xxx xx xx - MTS\n    063 xxx xx xx - Life:)\n    066 xxx xx xx - MTS\n    067 xxx xx xx - Kyivstar\n    068 xxx xx xx - Beeline\n    093 xxx xx xx - Life:)\n    095 xxx xx xx - MTS\n    096 xxx xx xx - Kyivstar\n    097 xxx xx xx - Kyivstar\n    098 xxx xx xx - Kyivstar\n    099 xxx xx xx - MTS Test [Just return "MTS"]\n'
	rs = re.findall('0(\\d\\d).+ - (.*)\n', s)
	rm = re.findall('80(\\d\\d)\\d{7}', num)
	for i in rs:
		if rm[0] in i:
			if 'Test' in i[1]:
				return 'MTS'
			return i[1]
	return 'no info'