I kept nearly all of the books I bought for foreign language and linguistics courses as an undergrad and grad student. Sold back virtually everything else when the courses ended.
I was really lucky a few times, because the assigned textbooks were things I had picked up months/years earlier at local used book stores or the Friends of the Berkeley Public Library's big annual book sale. So instead of paying $40 or whatever for
French for Reading Knowledge, I already had a copy that I had bought for 35 cents.
You couldn't buy books online, much less download them, back in those days. The World Wide Web came into existence about a year after I started grad school, and I was done with all my coursework before Amazon and eBay even existed.