Answer :
They are in the f-block, as they have f-subshells. This is due to their electronic arrangement. Their electronic arrangement is such that: in lanthanides, 4f orbitals are filled before the 5d orbitals are filled, and in actinides, 5f orbitals are filled before 6d orbitals are filled. Two photos are attached to further explain this.
![View image AfroBen](https://us-static.z-dn.net/files/d7d/65e7d55e4259fd352ffc079906a27631.gif)
![View image AfroBen](https://us-static.z-dn.net/files/d0b/bf90b1e8ddd62bb942232bdb6afa359a.gif)