[Tutor] Help with Python

Glen Chan gchan401 at msn.com
Fri May 16 03:58:07 CEST 2014


Hello, I am student trying to fugure out why when I enter any number it says error. It's only suppose to do that  if it's out the 1-10 range. Please help. Thank you.
 
number = input('Enter a number between 1 and 10: ')
while number < 1 or number > 10:
      print 'Please enter a number between 1 and 10'
      number = input('Enter a number between 1 and 10: ')
      
number = input('Enter a number between 1 and 10: ')      
while number > 1 or number < 10:
      print 'Error'
      number = input('Enter a number between 1 and 10: ')      
endProgram = raw_input('Do you want to end program? (Enter no or yes): ')
while not (endProgram == 'yes' or endProgram == 'no'):
           print 'Please enter a yes or no'
endProgram = raw_input('Do you want to end program? (Enter no to process a new set of scores): ')
 
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20140515/6edf1b85/attachment.html>


More information about the Tutor mailing list