Skip to content

Latest commit

 

History

History
36 lines (27 loc) · 1.03 KB

File metadata and controls

36 lines (27 loc) · 1.03 KB

**Scenario: ** Partner A told Partner B that the client wants to input the dividend amount instead of hardcoding it. Partner A will be on Boracay for a month long vacation and she left to you this source file:

explain_me

As partner B, can you explain the code by just scanning it? Can you easily change it to cater the new requirements?

Let's read PEP8 guidelines.

From PEP8:

  • Readability counts - code is read much more often that it is written!
  • The guideline is intended to improve the readability of code and make it consistent.
  • It is a guide not a law!

Now, which of the ff. are PEP8 compliant?

income = (gross_wages +
          taxable_interest +
          (dividends - qualified_dividends) -
          ira_deduction -
          student_loan_interest)

or

income = (gross_wages
          + taxable_interest
          + (dividends - qualified_dividends)
          - ira_deduction
          - student_loan_interest)