New course! Every coder should learn Generative AI!
Try a free lesson+ 1
Unfortunately you code won't work as you want here in SoloLearn because SoloLearn's code playground input system is not interactive like your normal computer console.
I'm pretty sure this code will work fine in computer or other interactive ide.