How to add comments in python ?

 Comments

Comments are used to add a remark or a note in the 

source code. Comments are not executed by interpreter.They are added with the purpose of making the source 

code easier for humans to understand. They are used 

primarily to document the meaning and purpose of 

source code and its input and output requirements, 

so that we can remember later how it functions and 

how to use it. For large and complex software, it may 

require programmers to work in teams and sometimes, 

a program written by one programmer is required to be 

used or maintained by another programmer. In such 

situations, documentations in the form of comments 

are needed to understand the working of the program.

Write a Python program to find the sum of 

two numbers.

#Program 5-4

#To find the sum of two numbers

num1 = 10

num2 = 20

result = num1 + num2

print(result) 

Output:

30

Comments

Popular posts from this blog

How to create a set in python