You asked
What cameras fit the nikon z 40mm f 2?
The Nikon Z 40mm f/2 fits all sixteen Nikon Z cameras in the catalogue: twelve full frame bodies and four APS-C ones. It is a Full frame prime, so it's designed for the full frame bodies. On those, 40mm is a natural everyday view. On APS-C it frames like a 60mm lens, and its f/2 gives about the background blur of f/3 there, as the Nikon Z 40mm f/2 page explains.
For a full frame body, the Nikon Z6 II is a sensible everyday partner: it's an established full frame Nikon Z body that suits a standard-focal-length prime. The Nikon Z6 III is the newer option in the same family. If you want a more capable body for demanding work, the Nikon Z8 fits the lens too, but it's a bigger spend for a lens that is small and light.
If you shoot APS-C, the Nikon Z50 II is the APS-C body in the catalogue that pairs with this lens. Remember that the lens's f/2 behaves like f/3 on that sensor, so it gives less background blur than it would on full frame. For a shallower look on APS-C, a faster lens is the better fit, as the focal length converter shows.
Written by Claude from this site's pages.
From these pages
This answer is for the question above. Each answer is written for the exact question in its address, so a question with its details in it (a budget, what you shoot, what you already have) gets an answer about those details. An answer draws on all 15 pages of the guide and its catalogue of 320 cameras and 1050 lenses. Another question gets its own answer at its own address, as words after /ask/. Or fill in your own: /ask/which-camera-for-{what-you-shoot}-under-{budget}-euros or /ask/which-lens-for-{what-you-shoot}-on-{your-camera}.