id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

mic@mathcs.emory.edu lab2 > median3
prev  |  next  |  chance

Given 3 numbers, return their median. That is, the value that would be in the middle if they were in sorted order. Hint: you might use the built-in max/min functions, like min(a,b) or max(a,b,c).


median3(1, 2, 3) → 2
median3(4, 1, 0) → 1
median3(5, 9, 8) → 8

...Save, Compile, Run (ctrl-enter)

def median3(n1,n2,n3):

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help

Difficulty: 100

Copyright Nick Parlante 2017 - privacy