Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

check if number in range python

import random 
l = [20, 40, 60, 80, 100]
 
y = 88

if y>0 and y<=l[0]:
     print("in range 0-20")
for i in range(1,len(l)-1):
    if y>l[i] and y<=l[i+1]:
        print(i)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #check #number #range #python
ADD COMMENT
Topic
Name
3+3 =