Skip to content

Commit ec6fcc9

Browse files
committed
Search in list
1 parent 5d27c99 commit ec6fcc9

File tree

1 file changed

+16
-0
lines changed
  • Searching in the List

1 file changed

+16
-0
lines changed

Searching in the List/1.py

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Python provides two operators that let you check if an item is in a list or not
2+
3+
4+
5+
6+
var = [1, 2, 3, 4, 5, 6, 7, 8, 9]
7+
8+
print(10 in var)
9+
10+
print(1 in var)
11+
12+
print(22 not in var)
13+
14+
# These are logical operators that return True or False
15+
16+
# They do not modify the list

0 commit comments

Comments
 (0)