The f-number is defined as:
Focal length divided by the diameter of the aperture.
For a lens with an aperture diameter of 28mm and a focal length of 50mm, the f-number is thus 50/28 = 1.8.
The aperture diameter is adjustable, so usually the maximum aperture (minimum f-number) is quited as the specs for the lens.
For zoom lenses, it is easier and cheaper to design aperture mechanism that does not change the aperture diameter as the lens' focal length is changed (zoomed in or out), such a lens will have a varying minimum f-number. So when you see a lens specified as 35~135mm f/3.5~4.5, it means that at 35mm focal length zoom position, the f-number is 3.5, and at 135mm focal length zoom position, the f-number is 4.5.
Zoom lenses with constant maximum aperture are usually more costly, as the aperture mechanism is more complex such that the aperture diameter is varied across the zoom range (without changing the setting on the aperture ring) to maintain a constant f number.