Previous | Next


Comment you code:

It’s always a good idea to include comments with your code. A well-written comments help to document your work and make it easy to understand by someone who will work on your code in future.

Use a triple quote for multiple-line comments.
>>> def ReturnTotal(x, y)
  '''This function will return
  the total value of x + y
  .g (x+y)'''

  return x+y
Use # for single-line comments.
>>> def ReturnTotal(x, y)
  # This function will return the total value of x + y
  return x+y

Previous | Next