Overview

Introduction to Python

Python is an easy to learn and very powerful programming language. It has efficient data structures and a simple approach to object-oriented programming. Python’s syntax together with its interpreted nature, make it an ideal language for scripting and rapid application development.

The Python interpreter and the python standard library are freely available for all major platforms from the Python’s official web site, https://www.python.org/.

Why it is called Python?


Python programming language was originally designed by Guido van Rossum. When he began implementing Python, he was also reading the scripts from “Monty Python’s Flying Circus” (a BBC comedy series). He wanted a short, unique, and slightly mysterious name of language, so he decided to call the language Python. Python computer language has nothing to do with reptiles (pythons).

Comments in Python

It is good practice to write comments in program code. In the header part of your program, you can write your name, date of program and practical definition. Comments are also used to describe the program logic.

Many of the python Practicals in this site include comments.
  • # (hash) is the character used for Comments in Python. Any line started with # in Python code is considered as a comment line.
  • A comment may appear at the start of a line but not within a string literal. A # character within a string literal is just a hash character.
  • Comments are used to describe the code and are not interpreted by Python.

Example of Comments in Python Code

# This is the sample comment.
# Program is developed by K Patel.
# Date: 20-August-2019
# Definition: Python program to print Hello World.

print ("Hello Python Practicals")


Following # is not a comment as it is written inside a string

>>> print ("#Hello Python Practicals")
#Hello Python Practicals


1 comment:

  1. You are doing a great job by sharing useful information about Python Programming course. It is one of the post to read and imporove my knowledge in Python Programming .You can check our Comments In Python language,for more information about Python Comments Tutorial.

    ReplyDelete