Guest User

Untitled

a guest
Jul 16th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. "The median cannot be found"
  2.  
  3. def print_median(seq):
  4. if print_median(sep) = None:
  5. print("The median cannot be found.")
  6. else:
  7. median = (seq[len(seq) // 2 - 1] + seq[len(seq) // 2]) / 2
  8. print("The median of " + str(seq) + " is " + str(median) + ".")
  9.  
  10. >>> print_median(())
  11. The median cannot be found.
  12.  
  13. >>> print_median((-12, 0, 3, 9))
  14. The median of (-12, 0, 3, 9) is 1.5.
Add Comment
Please, Sign In to add comment