You asked
Pentax hd da 20 40mm f 2 8 4 ed limited dc wr vs pentax smc da 16 45mm f 4 ed al?
The 16-45mm f/4 is the better fit for most landscape work. The 20-40mm f/2.8-4 is the better fit for low light.
Both are zooms for Pentax K-mount APS-C bodies, and both fit the same long list of cameras, including the K-1 and K-1 Mark II in APS-C crop mode. Neither is stabilised. The guide's Landscape advice is that you'll usually shoot between f/8 and f/11, so you don't need a fast aperture. That makes the 16-45mm's constant f/4 enough for landscapes.
The 16-45mm frames like 24-68mm on full frame, so it gives you a wider view for skies and foregrounds. The 20-40mm frames like 30-60mm on full frame. It is brighter at the wide end, at f/2.8, which helps indoors or at dusk. It also comes in a small metal barrel and carries the Limited name, so it's the one to consider if you want a more refined build.
The guide's price section for these two lenses isn't covered here, so this answer can't compare what they cost. Check the individual lens pages for current prices.
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}.