ITERATION AND LOOPS.
largest = None
smallest = None
store=[]
while True:
try:
num = raw_input("Enter a number: ")
if num == "done" : break
else:
store.append(num)
except:
print("U have an invalid entry")
largest=max(store)
smallest=min(store)
print "Invalid input"
print "Maximum is",largest
print "Minimum is",smallest
largest = None
smallest = None
store=[]
while True:
try:
num = raw_input("Enter a number: ")
if num == "done" : break
else:
store.append(num)
except:
print("U have an invalid entry")
largest=max(store)
smallest=min(store)
print "Invalid input"
print "Maximum is",largest
print "Minimum is",smallest
Coursera Exercise 5.2:Programming for EveryBody
Reviewed by Unknown
on
05:52
Rating:
No comments: