<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def calc(rest):
	"Perform a basic calculation"
	mo = calc_exp.match(rest)
	if mo:
		try:
			return str(eval(rest))
		except Exception:
			return "eval failed... check your syntax"
	else:
		return "misformatted arithmetic!"