Python - Introduction Comments

Introduction

Python uses # mark to add end of line comments.

Comments add human-readable documentation for your code.

You can add documentation strings to your code.

Demo

a = 3                  
b = 4 #  www .  j  a va  2  s  .  c  o m
print( a + 1, a - 1 )           # Addition (3 + 1), subtraction (3 - 1) 
print( b * 3, b / 2 )           # Multiplication (4 * 3), division (4 / 2) 
print( a % 2, b ** 2 )          # Modulus (remainder), power (4 ** 2) 
print( 2 + 4.0, 2.0 ** b )      # Mixed-type conversions

Result