id/email
password
forgot password
about | help | done | prefs | create account
CodingBat code practice

Python > Logic-1 > in1to10
prev  |  next  |  chance

Given a number n, return True if n is in the range 1..10, inclusive. Unless "outsideMode" is True, in which case return True if the number is less or equal to 1, or greater or equal to 10.

in1to10(5, False) → True
in1to10(11, False) → False
in1to10(11, True) → True

...Save, Compile, Run

See also Python Example Code. Python help docs: Python Strings | Python Lists | Python If Boolean


prev  |  next  |  chance   |  CodingBat  >  Logic-1

Forget It! -- delete my code for this problem 121.0

Copyright Nick Parlante 2006-10 - privacy