Skip to content

Latest commit

 

History

History
76 lines (56 loc) · 1.41 KB

PEP_right_or_wrong.md

File metadata and controls

76 lines (56 loc) · 1.41 KB

1. Code alignment

Which of the below alignments are correct?

  • a

      abs_area = area_A + area_B +
        area_C + area_D
    
  • b

      abs_area = area_A + area_B 
          + area_C + area_D
    
  • c

      result = my_function(area_A, area_B, 
          area_C, area_D)
    
  • d

      result = my_function(area_A, area_B, 
                           area_C, area_D)
    
  • e

      result = my_function(
          area_A, area_B, 
          area_C, area_D
          )
    

2. Naming conventions

Which of the below naming conventions are correct?

Classes:

  • a class my-first-analysis:
  • b class my_first_analysis:
  • c class Myfirstanalysis:
  • d class MyFirstAnalysis:

Functions:

  • a def calc_area(x):
  • b def calc-area(x):
  • c def calcarea(x):
  • d def Calc_area(x):

Variables:

  • a O = abs(x)
  • b I = abs(x)
  • c l = abs(x)
  • d abs_x = abs(x)

Constants:

  • a THRESHOLD = 0.1
  • b threshold = 0.1
  • c Threshold = 0.1
  • d T = 0.1

Other:

  • a list = my_areas
  • b list_ = my_areas
  • c __list__ = my_areas
  • d _list = my_areas

Modules:

  • a Numerical.py
  • b numerical.py
  • c numerical_analysis.py
  • d numerical-analysis.py

Packages:

  • a MyCoolPackage
  • b my-cool-package
  • c my_cool_package
  • d analysator