Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # #!/usr/bin/python
- #
- # By dvdjaco
- # Exercise 5.2
- #
- # Write another program that prompts for a list of numbers as above and at the end
- # prints out both the maximum and minimum of the numbers instead of the average.
- l = list()
- while True:
- num = (raw_input("Enter a number: "))
- if num == 'done' : break
- try:
- l.append(float(num))
- except:
- print "Invalid input"
- print max(l), min(l)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement