forked from epequeno/python-for-informatics
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path02.py
More file actions
29 lines (25 loc) · 647 Bytes
/
02.py
File metadata and controls
29 lines (25 loc) · 647 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 22 19:04:17 2014
@author: Estevan Adrian Pequeno
"""
'''
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.
'''
def calc():
numbers = []
count = 0
while True:
get_num = raw_input("Enter a number: ")
if get_num == 'done':
print min(numbers), max(numbers)
break
else:
try:
numbers.append(float(get_num))
except:
print "Invalid input"
continue
calc()