In quantum mechanics electrons are arranged in certain orbitals namely s, p, d and f orbitals.The position of the electrons are determined by 4 sets of quantum numbers n, l, m and s. Electrons can only be at a fixed distance from a nucleus which is determined by the quantum number n, but in p, d and f orbitals how does it manage to be at a fixed distance at every point in the region of these orbitals?(here is an example of p orbital in image)
I think you're confusing what the orbital shapes represent. The shapes are probability distributions-which means that you're most likely to find the electron somewhere within the shape.
Electrons can only be at a fixed distance from a nucleus
This is false
which is determined by n quantum number
n quantum number tells you how big the orbital is-not precisely how far away the electron is.
In reality, the electron is moving around the atom, and is probably somewhere within the orbital shape.