Not a book, but CS50x is a freely available course with high quality videos and lecture notes. The lecture exercises are programming projects of sorts. It teaches programming from scratch with C and then Python. Plus, since a lot of students take it, there are lots of online resources with tips, like the CS50 subreddit.
https://cs50.harvard.edu/x/2023/