First, your code is unreadable and so anyone here who knows Python would be hard pressed to help you.
Second, Jupyter is not just about Python. This forum is for issues caused by Jupyter and not for issues caused by languages that can be run in the language kernels that Jupyter can use.
Please read and follow Getting good answers to your questions in future posts here.
More details on those two points:
This is not pertinent to this forum. Unless there’s something your formatting is hiding (or more accurately, lack-there-of, see below), you’d most likely have the same issue if you were running this as a Python script from the command line with that code as the content or if you pasted that into an IPython interpreter console. ((Hence, that makes it not a Jupyter issue.**
When you find the appropriate location for your post…
For posting on forums such as this you’ll want to learn how to use code blocks to keep the formatting of the lines. Without the indentation, it is hard for anyone to help you. See here, with special attention to ‘Block code formatting’. (More help can be found here and here. That skill will help you posting in here and many other places, such as StackOverflow which may be better suited for your issue.