There is no better way to learn coding and electronics than building your own robots. Ruth Amos has built a LEGO Robot Pumpkin powered by Raspberry Pi that can be used to pull pranks on friends. It uses LEGO Technic motors, 8×8 LED matrices, and other affordable parts.
Ruth used Teachable Machines to train her machine learning model. The above video gives you a better idea how this works. More info is available on Instructables.