0
How to find input present in list or not @ python
let I gave input 20, and list [1-100], now what to do to find whether 20 present in list or not. how to code and what to use
1 Answer
+ 2
Use 'in' operator, here's an example:
l = list(range(1, 101)) # make list 1-100
print(20 in l)
print( 50 in l)
print(l)