Given an array of 4 integers  
```[a,b,c,d]``` representing two points ```(a, b)``` and ```(c, d)```, return a string representation of the slope of the line joining these two points. 

For an undefined slope (division by 0), return  ```undefined```  . Note that the "undefined" is case-sensitive.
```
   a:x1
   b:y1
   c:x2
   d:y2
```
   
Assume that ```[a,b,c,d]``` and the answer are all integers 
(no floating numbers!).
Slope:

Source: codewars | Difficulty: EASY
Tags: Matrices

Fundamentals

Mathematics

Starter code: def find_slope(points):
	

Solutions:
def find_slope(points):
	(x1, y1, x2, y2) = points
	if x2 - x1 == 0:
		return 'undefined'
	return str((y2 - y1) // (x2 - x1))


def find_slope(points):
	(x1, y1, x2, y2) = points
	dx = x2 - x1
	dy = y2 - y1
	if dx != 0:
		return str(int(dy / dx))
	else:
		return 'undefined'


def find_slope(points):
	run = points[0] - points[2]
	rise = points[1] - points[3]
	return 'undefined' if run == 0 else '%d' % (rise / run)


def find_slope(points):
	(x1, y1, x2, y2) = points
	try:
		slope = f'{(y2 - y1) // (x2 - x1)}'
	except ZeroDivisionError as e:
		slope = 'undefined'
	return slope


from typing import List

def find_slope(points: List[int]) -> str:
	try:
		return str((points[3] - points[1]) // (points[2] - points[0]))
	except ZeroDivisionError:
		return 'undefined'


def find_slope(points):
	try:
		return str(int((points[3] - points[1]) / (points[2] - points[0])))
	except:
		return 'undefined'


def find_slope(points):
	delta_x = points[2] - points[0]
	delta_y = points[3] - points[1]
	if delta_x == 0:
		return 'undefined'
	return str(delta_y // delta_x)


find_slope = lambda p: str(int(1.0 * (p[3] - p[1]) / (p[2] - p[0]))) if p[2] - p[0] != 0 else 'undefined'


from typing import List

def find_slope(points: List[int]) -> str:
	(x1, y1, x2, y2) = points
	try:
		return str(int((y2 - y1) / (x2 - x1)))
	except ZeroDivisionError:
		return 'undefined'


def find_slope(points):
	lower = points[2] - points[0]
	upper = points[3] - points[1]
	if upper == 0 and lower == 0:
		return 'undefined'
	elif upper == 0:
		return '0'
	elif lower == 0:
		return 'undefined'
	else:
		return str(int(upper / lower))


def find_slope(points):
	if points[2] == points[0]:
		return 'undefined'
	a = int((points[3] - points[1]) / (points[2] - points[0]))
	print(a)
	return str(a)


def find_slope(points):
	side1 = points[2] - points[0]
	side2 = points[3] - points[1]
	return str(side2 // side1) if side1 != 0 else 'undefined'


def find_slope(points):
	(x1, y1, x2, y2) = (points[0], points[1], points[2], points[3])
	if x1 == x2:
		return 'undefined'
	else:
		return str(int((y1 - y2) / (x1 - x2)))


def find_slope(points):
	vertical_change = points[3] - points[1]
	horizontal_change = points[2] - points[0]
	try:
		slope = vertical_change / horizontal_change
	except ZeroDivisionError:
		return 'undefined'
	return str(int(slope))


def find_slope(points):
	if points[2] - points[0] == 0:
		return 'undefined'
	else:
		sloope = (points[3] - points[1]) // (points[2] - points[0])
		return str(sloope)


def find_slope(points):
	try:
		return str(round((points[3] - points[1]) / (points[2] - points[0])))
	except ZeroDivisionError:
		return 'undefined'


def find_slope(p):
	y = p[3] - p[1]
	x = p[2] - p[0]
	if x == 0:
		return 'undefined'
	return str(int(y / x))


def find_slope(points):
	return str(int((points[1] - points[3]) / (points[0] - points[2]))) if len(points) == 4 and points[0] - points[2] != 0 else 'undefined'


def find_slope(points):
	(x1, y1, x2, y2) = points
	return str((y2 - y1) // (x2 - x1)) if x2 != x1 else 'undefined'


def find_slope(points):
	(a, b, c, d) = points
	if c != a:
		return str(int((d - b) / (c - a)))
	else:
		return 'undefined'


def find_slope(points):
	dx = points[2] - points[0]
	dy = points[3] - points[1]
	try:
		m = dy / dx
		return f'{int(m)}'
	except:
		return 'undefined'


def find_slope(points):
	(x1, y1, x2, y2) = points
	try:
		slope = (y2 - y1) / (x2 - x1)
		return str(round(slope))
	except:
		return 'undefined'


def find_slope(p):
	if p[2] - p[0] == 0:
		return 'undefined'
	else:
		return f'{int((p[3] - p[1]) / (p[2] - p[0]))}'


def find_slope(points):
	a = points[0]
	b = points[1]
	c = points[2]
	d = points[3]
	if c - a == 0:
		return 'undefined'
	else:
		return str(int((d - b) / (c - a)))


import math

def find_slope(points):
	delta_x = points[3] - points[1]
	delta_y = points[2] - points[0]
	if delta_y == 0:
		return 'undefined'
	return str(math.floor(delta_x / delta_y))


def find_slope(points):
	if points[-2] == points[0]:
		return 'undefined'
	return str(int((points[-1] - points[1]) / (points[-2] - points[0])))


from math import hypot

def find_slope(points):
	return str((points[3] - points[1]) // (points[2] - points[0])) if points[2] != points[0] else 'undefined'


def find_slope(p):
	if p[2] == p[0]:
		return 'undefined'
	else:
		return str((p[3] - p[1]) // (p[2] - p[0]))


def find_slope(points):
	x = points[2] - points[0]
	y = points[3] - points[1]
	if x == 0:
		return 'undefined'
	else:
		return str(int(y / x))


def find_slope(points):
	if points[2] - points[0] == 0:
		return 'undefined'
	m = (points[3] - points[1]) / (points[2] - points[0])
	res = int(m)
	return str(res)


def find_slope(points):
	(a, b, c, d) = points
	if a == c:
		return 'undefined'
	return str((d - b) // (c - a))


def find_slope(points):
	x = points[2] - points[0]
	y = points[3] - points[1]
	return f'{round(y / x)}' if x else 'undefined'


def find_slope(points):
	try:
		print('points =', points)
		(x1, y1, x2, y2) = points
		slope = (y2 - y1) / (x2 - x1)
		return f'{slope:.0f}' if slope != 0 else '0'
	except (TypeError, ValueError, ZeroDivisionError):
		return 'undefined'


def find_slope(points: list):
	try:
		(x1, y1, x2, y2) = points
		return str((y2 - y1) // (x2 - x1))
	except:
		return 'undefined'


def find_slope(p):
	y = p[1] - p[3]
	x = p[0] - p[2]
	if x == 0:
		return 'undefined'
	else:
		return '{}'.format(int(y / x))


def find_slope(points):
	try:
		result = (points[3] - points[1]) // (points[2] - points[0])
		return '%s' % (result,)
	except ZeroDivisionError:
		return 'undefined'


def find_slope(s):
	try:
		d = (s[3] - s[1]) // (s[2] - s[0])
		return str(d)
	except:
		return 'undefined'


def find_slope(points):
	try:
		return f'{int((points[3] - points[1]) / (points[2] - points[0]))}'
	except ZeroDivisionError:
		return 'undefined'


def find_slope(points):
	top_of_equation = points[3] - points[1]
	bot_of_equation = points[2] - points[0]
	if bot_of_equation == 0:
		return 'undefined'
	return str(int(round(top_of_equation / bot_of_equation)))


def find_slope(points):
	(a, b, c, d) = points
	try:
		return str((d - b) // (c - a))
	except ZeroDivisionError:
		return 'undefined'


def find_slope(points):
	(x0, y0, x1, y1) = (points[0], points[1], points[2], points[3])
	if x1 - x0 == 0:
		return 'undefined'
	return str((y1 - y0) // (x1 - x0))


def find_slope(points):
	dx = points[2] - points[0]
	dy = points[3] - points[1]
	return str(dy // dx) if dx != 0 else 'undefined'


def find_slope(points):
	x1 = points[0]
	x2 = points[2]
	y1 = points[1]
	y2 = points[3]
	x3 = x2 - x1
	y3 = y2 - y1
	if x3 == 0:
		return 'undefined'
	else:
		return f'{y3 // x3}'


find_slope = lambda points: str((points[3] - points[1]) // (points[2] - points[0])) if points[2] - points[0] != 0 else 'undefined'


def find_slope(points):
	(x1, y1, x2, y2) = points
	return f'{(y2 - y1) // (x2 - x1)}' if x1 != x2 else 'undefined'