I graduated from university about five months ago, and have been working in a local startup for past four months. While at university, I studied Haskell, F# etc on my own. We were taught Java at the university, but I was exposed to functional programming very soon, and have spent far more time with it than I did with imperative programming. As a result, my brain is wired for a functional thinking. The company I have joined uses Python, and the code is heavily imperative. I am having a very hard time reading imperative code. I cannot keep a track of mutations. When an for-if-else-for-... nesting goes more than four levels deep, I completely lose the track of what's happening in the code. To add to it, Python is a dynamic language, so there are no types in the code. It's been weeks since I have been trying to understand a part of our codebase (which is supposedly 'moderately complex'), but I haven't made any appreciable progress so far in understanding it. Please offer me some practical techniques on how I should go about understanding that code. Thanks in advance!
Edit:
Maybe I should also mention that there aren't really many comments in the code, and the names are also not very intuitive.