Most of this will come down to reading [PEP8][0], however I'll state them here anyway. - `if` statements don't need parentheses, so don't put them around them. You seem to go between doing this and not, remember to also be consistent - Functions at module level should have two new lines between them and other things, rather than one as you have now - In your function calls, you have unexpected spaces around keyword/parameter assignments - There should also be two blank lines between the `import` statements and other code - You should have at least two spaces before inline comment. - Many of your lines are too long, they should only be 79 characters maximum - In [*Whitespace in Expressions and Statements*][1], > Avoid extraneous whitespace in the following situations: > > ... > > Immediately before a comma, semicolon, or colon: > > Yes: if x == 4: print x, y; x, y = y, x > No: if x == 4 : print x , y ; x , y = y , x - You shouldn't have multiple statements on one line (there should be a newline after the colon) - There is no newline at end of file as seen here. [0]: https://www.python.org/dev/peps/pep-0008/ [1]: https://www.python.org/dev/peps/pep-0008/#whitespace-in-expressions-and-statements