# Fix the Bugs (Syntax) - My First Kata

## Overview

Hello, this is my first Kata so forgive me if it is of poor quality.

In this Kata you should fix/create a program that ```return```s the following values:

 - ```false/False``` if either a or b (or both) are not numbers
 - ```a % b``` plus ```b % a``` if both arguments are numbers

You may assume the following:

1. If ```a``` and ```b``` are both numbers, neither of ```a``` or ```b``` will be ```0```.

## Language-Specific Instructions

### Javascript and PHP

In this Kata you should try to fix all the syntax errors found in the code.

Once you think all the bugs are fixed run the code to see if it works.  A correct solution should return the values specified in the overview.

**Extension: Once you have fixed all the syntax errors present in the code (basic requirement), you may attempt to optimise the code or try a different approach by coding it from scratch.**

Source: codewars | Difficulty: EASY

Starter code: def my_first_kata(a,b):
	

Solutions:
def my_first_kata(a, b):
	if type(a) == int and type(b) == int:
		return a % b + b % a
	else:
		return False


def my_first_kata(a, b):
	try:
		return a % b + b % a
	except (TypeError, ZeroDivisionError):
		return False


def my_first_kata(a, b):
	return type(a) == type(b) == int and a % b + b % a


my_first_kata = lambda a, b: a % b + b % a if type(a) is type(b) is int else False


def my_first_kata(a, b):
	return set(map(type, (a, b))) == {int} and a % b + b % a


def my_first_kata(a, b):
	return all((type(x) == int for x in (a, b))) and a % b + b % a


def my_first_kata(a, b):
	try:
		return a % b + b % a
	except:
		return False


def my_first_kata(a, b):
	if type(a) in (int, float) and type(b) in (int, float):
		return a % b + b % a
	return False


from typing import Union

def my_first_kata(a: Union[int, str], b: Union[int, str]) -> Union[bool, int]:
	return False if not all(map(lambda _: type(_) in (int, float), [a, b])) else a % b + b % a


my_first_kata = lambda a, b: int == type(a) == type(b) and a % b + b % a


def my_first_kata(a, b):
	if str(a).isnumeric() is False or str(b).isnumeric() is False:
		return False
	else:
		return int(a) % int(b) + int(b) % int(a)


def my_first_kata(a, b):
	print(a)
	print(b)
	valid_a = isinstance(a, int) and type(a) == type(0)
	valid_b = isinstance(b, int) and type(b) == type(0)
	if valid_a and valid_b:
		return a % b + b % a
	else:
		return False


def my_first_kata(a, b):
	if not type(a) in (int, float) or not type(b) in (int, float):
		return False
	return a % b + b % a


def my_first_kata(a, b):
	if type(a) == type(b) == 'number':
		return False
	try:
		return a % b + b % a
	except:
		return False


def my_first_kata(a, b):
	if type(a) != int or type(b) != int:
		return False
	elif a == 0 or b == 0:
		return False
	else:
		return a % b + b % a


def my_first_kata(a, b):
	if isinstance(a, int) and isinstance(b, int) and (a * b != 0):
		return a % b + b % a
	else:
		return False


def my_first_kata(a, b):
	try:
		if str(a).isdigit() and str(b).isdigit():
			return a % b + b % a
		else:
			return False
	except:
		return False


def my_first_kata(a, b):
	print(type(a))
	print(type(b))
	print(a)
	print(b)
	try:
		print(a % b + b % a)
		return a % b + b % a
	except (TypeError, ZeroDivisionError):
		return False


def my_first_kata(a, b):
	if type(a) != int or type(b) != int:
		return False
	if type(a) == int and type(b) == int:
		return a % b + b % a


def my_first_kata(a, b):
	if str(a).isdigit() and str(b).isdigit():
		res = a % b + b % a
		return res
	else:
		return False


def my_first_kata(a, b):
	if not isinstance(a, int) or not isinstance(b, int):
		return False
	try:
		sum = a % b + b % a
		return sum
	except ZeroDivisionError:
		return False


def my_first_kata(a, b):
	try:
		if type(a) == str or type(b) == str:
			return False
		if type(a) == dict or type(b) == dict:
			return False
		else:
			return a % b + b % a
	except ZeroDivisionError:
		pass


def my_first_kata(a, b):
	try:
		return a % b + b % a if all(map(lambda x: type(x) == int, (a, b))) else False
	except ZeroDivisionError:
		return False


def my_first_kata(a, b):
	if 'int' in str(type(a)) and 'int' in str(type(b)):
		return a % b + b % a
	else:
		return False


def my_first_kata(a, b):
	print(a, b)
	if not isinstance(a, int) and (not isinstance(b, int)):
		return False
	else:
		try:
			return a % b + b % a
		except:
			return False


def my_first_kata(a, b):
	if type(a) == int and type(b) == int:
		return a % b + b % a
	else:
		return 0


def my_first_kata(a, b):
	if type(a) != float and type(a) != int or (type(b) != float and type(b) != int):
		return False
	else:
		return a % b + b % a


def my_first_kata(a, b):
	if type(a) == str:
		return False
	if type(b) == str:
		return False
	else:
		return a % b + +b % a


def my_first_kata(a, b):
	if type(a) is type(b):
		return a % b + b % a
	else:
		return False


def my_first_kata(a, b):
	if isinstance(a, bool) or isinstance(b, bool):
		return False
	if isinstance(a, int) and isinstance(b, int):
		return a % b + b % a
	return False


def my_first_kata(a, b):
	msg = False
	if isinstance(a, int) and isinstance(b, int) and (a != 0) and (b != 0):
		msg = a % b + b % a
	return msg


def my_first_kata(a, b):
	print(a, b)
	if isinstance(a, int) and isinstance(b, int) and (not isinstance(a, bool)) and (not isinstance(b, bool)):
		return a % b + b % a
	else:
		return False


def my_first_kata(a, b):
	if not isinstance(a, int) or not isinstance(b, int):
		return False
	if a == 0 or b == 0:
		return False
	return a % b + b % a


from contextlib import suppress

def my_first_kata(a, b):
	if type(a) == type(b) == int:
		with suppress(ZeroDivisionError):
			return a % b + b % a
	return False


def my_first_kata(a, b):
	if any([t not in ['int', 'float'] for t in (type(a).__name__, type(b).__name__)]):
		return False
	else:
		return a % b + b % a


def my_first_kata(a, b):
	print(a, b)
	if type(a) in [int, float, complex] and type(b) in [int, float, complex]:
		return a % b + b % a
	else:
		return False


def my_first_kata(a, b):
	if a == None or b == None:
		return False
	if a == [] or b == []:
		return False
	try:
		if a != 0 and b != 0:
			return a % b + b % a
	except TypeError:
		return False


def my_first_kata(a, b):
	x = isinstance(a, int)
	y = isinstance(b, int)
	if x and y == True:
		if a and b > 0:
			return a % b + b % a
		else:
			return False
	else:
		return False


def my_first_kata(a, b):
	try:
		if abs(float(a / 2 + b / 2)) > 0:
			return a % b + +b % a
		else:
			return False
	except:
		return False


def my_first_kata(a, b):
	if type(a) == type(b) == int:
		try:
			return a % b + b % a
		except ZeroDivisionError:
			return False
	else:
		return False


def my_first_kata(a, b):
	return False if not type(a) == int or not type(b) == int else a % b + +b % a


def my_first_kata(a, b):
	try:
		if type(a) is bool or type(b) is bool:
			raise TypeError('why')
		return a % b + b % a
	except TypeError:
		return False


def my_first_kata(a, b):
	for item in (a, b):
		if type(item) != int:
			return False
	return a % b + +b % a


def my_first_kata(a, b):
	if isinstance(a, int) and isinstance(b, int):
		if a == 0 or b == 0:
			return False
		if a is None or b is None:
			return False
		else:
			return a % b + b % a
	else:
		return False


def my_first_kata(a, b):
	print(a, b)
	if not all((isinstance(x, int) for x in [a, b])):
		return False
	elif int(a) == 0 or int(b) == 0:
		return False
	else:
		return a % b + b % a


def my_first_kata(a, b):
	if type(a) != type(5) or type(b) != type(5):
		return False
	else:
		return a % b + b % a


def my_first_kata(a, b):
	return False if isinstance(a, (str, bool, dict)) or isinstance(b, (str, bool, dict)) else a % b + b % a


def my_first_kata(a, b):
	if type(a) == type(b) == type(1):
		return a % b + b % a
	else:
		return False


def my_first_kata(a, b):
	try:
		float(a)
		float(b)
		return a % b + b % a if a and b else False
	except:
		return False


def my_first_kata(a, b):
	if isinstance(a, int) & isinstance(b, int):
		return a % b + +b % a
	else:
		return False


def my_first_kata(a, b):
	if isinstance(a or b, str) or (a == 0 or b == 0):
		return False
	elif isinstance(a and b, int):
		if str(a) == 'True' or str(b) == 'True' or int(a % b + b % a) == 0 or (a == True and b == True):
			return False
		else:
			return int(a % b + b % a)
	else:
		return False


def my_first_kata(a, b):
	if type(a) == int:
		if type(b) == int:
			return a % b + b % a
	return False


import math

def my_first_kata(a, b):
	is_number = bool
	if_is_number = 1
	if type(a) != int or type(b) != int:
		is_number = False
	else:
		if_is_number = int(a) % int(b) + +int(b) % int(a)
	if is_number == False:
		return is_number
	else:
		return if_is_number


def my_first_kata(a, b):
	try:
		if complex(a) and complex(b):
			return a % b + b % a
		else:
			return False
	except:
		return False


def my_first_kata(a, b):
	if type(a) != type(1) or type(b) != type(1):
		return False
	elif type(a) == type(1) or type(b) == type(1):
		return a % b + b % a


def my_first_kata(a, b):
	if isinstance(a, bool) or isinstance(b, bool):
		return False
	if not isinstance(a, int) or not isinstance(b, int):
		return False
	elif a == 0 or b == 0:
		return False
	else:
		return a % b + +b % a


def my_first_kata(a, b):
	if type(a) is not int or type(b) is not int:
		return False
	else:
		try:
			return a % b + b % a
		except ZeroDivisionError:
			return False


def my_first_kata(a, b):
	print(a, b)
	if str(a).isdigit() and str(b).isdigit():
		return int(a) % int(b) + int(b) % int(a)
	else:
		return False


def my_first_kata(a, b):
	if not (isinstance(a, (int, float)) and isinstance(b, (int, float))):
		return False
	else:
		return a % b + b % a


def my_first_kata(a, b):
	print('>>>' + str(a) + '<<< >>>' + str(b) + '<<<')
	if isinstance(a, bool) or isinstance(b, bool):
		return False
	if isinstance(a, int) and isinstance(b, int):
		return a % b + b % a if a != 0 and b != 0 else False
	return False