13,420
edits
Changes
→PART 2 - Manipulating Items in Lists
if number in list_of_numbers: # Returns True if value in list, returns False if item not in list
number_index = list_of_numbers.index(number)
print('index is: ' + str(number_index))
else: # If the statement is False, the else will run
print(str(number) + ' is not in list_of_numbers')