For example, how does CAD save such a 3d shape?
I mean, does it save it like something:
points = [[0,0,0],[0,1,0],[1,1,0],[1,0,0]]
lines = [[points[1], points[2]],[points[2],points[3]]]
Because I want to draw some 3d shapes(in python and render it in webpages), and I want to know how they are stored in files.
As you can see from web-sites such as this one, there's no "one format to rule them all." Every CAD program (like every other computer program ...) wound up defining "its own, app-specific format." AutoCAD is just one of many. But there are also various "standard" (sic ...) formats ... almost-inevitably "XML-based" ... which were specifically designed to allow model-information to be shared among programs. Typically, you "export" the model to one of these formats.
"And then, you Google to find where somebody else(!) has already perfected a Python module that knows how to read that file-format." You can be quite sure that you will not have to write-and-debug that code yourself. (After all, "you are not the first soul to have needed to do this sort of thing ...")
Normally, you don't try to deal with "the application's native format," because, even if the vendor in question actually saw fit to publish it, it contains "everything, including the kitchen sink." Stuff that you don't need. An "export file" is usually preferable for (and, was designed for ...) this very reason.