функция exit ()

for val in range(0,5):
    if val == 3:
        print(exit)
        exit()
    print(val)