You like the way the Python `+` operator easily handles adding different numeric types, but you need a tool to do that kind of addition without killing your program with a `TypeError` exception whenever you accidentally try adding incompatible types like strings and lists to numbers.

You decide to write a function `my_add()` that takes two arguments. If the arguments can be added together it returns the sum. If adding the arguments together would raise an error the function should return `None` instead.

For example, `my_add(1, 3.414)` would return `4.414`, but `my_add(42, " is the answer.")` would return `None`.

Hint: using a `try` / `except` statement may simplify this kata.

Source: codewars | Difficulty: EASY
Tags: Fundamentals

Starter code: def my_add(a, b):
	

Solutions:
def my_add(a, b):
	try:
		return a + b
	except TypeError:
		return None


def my_add(*a):
	try:
		return sum(a)
	except:
		pass


def my_add(a, b):
	try:
		ans = a + b
		return ans
	except:
		return None


def my_add(a, b):
	try:
		return a + b
	except:
		pass


def my_add(a, b):
	return a + b if isinstance(a, (int, float, complex)) and isinstance(b, (int, float, complex)) else None


def my_add(a, b):
	try:
		a + b
	except:
		try:
			float(a, b)
		except:
			return None
	return a + b