You asked

Is the nikon d5300 or the d7200 the better used buy for a beginner who wants this lens?

The guide can't pick between these two cameras on price, because this site's camera pages don't give prices, and it can't tell which lens you mean by "this lens". Name the lens and it can check that it fits both bodies. Both use the same Nikon F mount and 24.2-megapixel APS-C sensor, and both have the same lens list, so either one works with the lens you choose.

The Nikon D5300 is the simpler body. It dates from 2013 and has no stabilisation in the body, so you rely on stabilised lenses for slow shutter speeds. The Nikon D7200 is from 2015 and is a weather-sealed enthusiast body with two card slots. For a beginner who may grow into it, the D7200 is the better body. For a beginner who wants the lightest, simplest kit, the D5300 is enough.

Whichever you pick, buy the lens used if you can. The guide notes that good lenses hold their value far better than bodies, so a used lens is the cheapest way to try a focal length. For a starting kit, the Nikon AF-S DX 18-55mm f/3.5-5.6G VR II is a sensible everyday zoom, and the Nikon AF-S DX 35mm f/1.8G is a small, fast prime for indoor and dim light. The guide's advice for a first camera is to not overthink it: handling and the lenses on offer matter more than small differences between bodies.

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}.