It was 30k new, but you could lease it for nearly nothing (a friend got $120/month) or buy it off-lease for about 10k. I bought one for 10k in 2016, drove it as a daily commuter until 2022 and sold it for 6k.
What do consider affordable? There are cheaper cars out there, a Kia Forte will run you $21k, but a new entry-level Honda Civic is $25k, with options it'll get above $30k.
The cheapest Model 3 is $42,500. The cheapest Model Y is $45,000.
Is that cheap?
The Leaf ($30,000) and Bolt ($27,500) are cheap_er_ (by a lot), but they are still not what I (and presumably parent) would consider cheap.