Posts

Showing posts with the label comments

PYTHON comments

 All programmers use program comments. Comments: - shows the significance of the variables, - clarification of the sequences, - state what restrictions must be observed, - specify the date when the program was written, - say who the author of the program is, - define the bibliography used, - helps in the maintenance process. Comments are written as follows: # short comment "" "on the start line of the comment and on the" "" end line of the comment. speed = [1, 2, 3, 4, 5] # speed list A_square = 25 # area of the square for i range (#): # gathers the elements of the X_list      sum + = X_list [i] "" " The program is written on March 30, 2022 The BELMAN KALABA algorithm is used The author is Ion IVAN "" " Including comments in programs is called self-documenting. (March 30, 2022)

Comments in PYTHON

  Programs must contain comments. The comments explain the sequence of instructions. Comments help maintain the program. Comments are written on a line using # Comments are written on multiple lines using "" "and" "" Comments help the programmer who takes over a program from another programmer who has left the team. The comments clarify everything. Comment programs are the best. Comments are written anywhere. Comments precede instruction sequences. Comments are written after each instruction. Comments must be visible. (March 28, 2022)