found = False print('Przed:', found) for value in [9, 41, 12, 3, 74, 15] : if value == 3 : found = True print(found, value) print('Po:', found)