[Tutor] check_range

Marc Gartler gartler at express.cites.uiuc.edu
Wed Dec 15 00:12:22 CET 2004


Hi all,

I am fairly new to both Python & programming, and am attempting to 
create a function that will test whether some user input is an integer 
between 10 and 89, but the check isn't happening...

def check_range(myrange):
	if range(myrange) != range(10,89):
		return "False"
	else:
		return "True"

...this gets called later via:
		if check_range(input):
			done = "True"
     			return int(input)


What am I doing wrong?

Thanks!



More information about the Tutor mailing list