Saturday, 16 January 2021

How to use comments in python

Single line comments
You can use # symbol for single line comments

For example,

#print function is used to output something
print ('Hello World')

Block Comments  ( Triple quotes comments)
Three quotes comments are considered as block comments in python.

For example,

"""
Author: Dinesh Dontha
Component: Payment Processing
Licence: ----
"""
print('Start of the program')
#some processing
print('End of the program')

How to print in python

You can use print () function in python to output something in python. 

    For example: 

    print ('Hello World ') 

You can also pass some argument into print function. 

     For example, 

     name = "Dinesh" 
     print (' Your are %s.', % name);