It’s probably best to limit yourself to a used laptop.
Reading and writing code is nothing more than reading and writing text, and for that you don’t need a fancy gpu or screen.
What I would recommend you look for in a laptop is
- an SSD instead of an HDD
- more cpu cores (at least 4 cores)
- more memory (RAM) (at least 8GB, preferably 16GB+)
More memory and cores will help you with compiling and running your code.
And make sure you take regular backups! You never know when your disk will fail.
Also make sure to check linux compatibility before you buy. Laptops used to be a pain (10+ years ago), and it’s gotten a lot better, but it’s not always perfect. Just search for “[brand] [model] linux” or try to find the model on the archlinux wiki.