Demo entry 6344402

Median Algorithm in Python

   

Submitted by anonymous on Jan 13, 2017 at 03:54
Language: Python 3. Code size: 210 Bytes.

def get_median(a,b,c):
	if c < a:
		if c > b:
			median = c
		elif a < b:
			median = a
		else:
			median = b
	elif b < a:
		median = a
	elif c < b:
		median = c
	else:
		median = b
	return median

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).