Time Calculator: In regards to README.md instructions - (Do not import any Python libraries.)

I’ve completed this assignment.

But taking another run at it, as I want to try to take a lot of bloat out of my code and optimise it so I don’t get a high cyclomatic complexity warning.

I’m curious, but the README.md file states (Do not import any Python libraries.)

Does this mean external libraries… for example like something along the lines of Beautiful Soup?

Can we import build in Modules/Libraries like Math etc though?

Or does that instruction extend to All Modules and Libraries? Be it build-in or external/3rd party.

Thanks to anyone who can clear that up for me.

I believe this refers to any libraries, both built-in and external. Some of them could make this whole project trivial. In a way that would use library for all heavy-lifting operations, which would basically invalidate point of doing this project.

Which library were you considering to import to help with complexity reduction?

1 Like

Thanks for the response @sanity much appreciated.

I figured it must apply, but was seconding guessing myself, as I’ve been having a look through the forums and some other participants solutions, trying to get some ideas of how I can cut down my conditional logic and thus reduce the cyclomatic complexity. I’ve seen some solutions, where for example, Math has been imported.

But then it has not been used to reduce complexity, but to, as you say, work the heavy-lifting. Agreed, it does make the project trivial if you use libraries to do the heavy-lifting.

From my reading and now having a better understanding of the warning and concept of cyclomatic complexity. I understand, what I need to do is break down my code into smaller modules and functions, instead of one long stream of if, elif and else statements inside one function.

Cheers :slight_smile:

1 Like