Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "The median cannot be found"
- def print_median(seq):
- if print_median(sep) = None:
- print("The median cannot be found.")
- else:
- median = (seq[len(seq) // 2 - 1] + seq[len(seq) // 2]) / 2
- print("The median of " + str(seq) + " is " + str(median) + ".")
- >>> print_median(())
- The median cannot be found.
- >>> print_median((-12, 0, 3, 9))
- The median of (-12, 0, 3, 9) is 1.5.
Add Comment
Please, Sign In to add comment