Step-by-step explanation:
There are 7 books that can go in the first spot.
After a book has been placed in the first spot, there are 6 books left that can go in the second spot.
After that, there are 5 books that can go in the third spot.
So on and so forth.
So the number of ways is:
7×6×5×4×3×2×1 = 7! = 5040