#!/usr/bin/python # while.py # Daniel Dalton # Some more experimenting: my book says to use an else after the loop? # Why use this else? Why not just write this code after the while loop is done? read = True number = 405 while read: guess = int(raw_input ("Enter a number:")) if guess == number: print "You got it!" read = False elif number < guess: print "Too high!" else: print "Too low!" else: # any point to this? print "Some else thing" #Why use the 'else' key word? When you could just do what I did in version 1? print "Loop end!"