Will Leaving The Keys Within The Car Prevent It From Locking?

So i had to pull over and shut it, but