Components of a Python Program - PowerPoint PPT Presentation

About This Presentation
Title:

Components of a Python Program

Description:

This presentation will educate about Components of Python Program, Literals in Python, Identifiers in Python, Variables in Python, and Constants in Python. – PowerPoint PPT presentation

Number of Views:8
Slides: 8
Provided by: Learnbay.Datascience

less

Transcript and Presenter's Notes

Title: Components of a Python Program


1
Components of Python Program
Swipe
2
Components of Python Program
Components of any Python Program are as below-
Suite
Literals
Comments
Constants
Python
Statement
Identifiers
Variables
Expression
Blocks and Indentations
reserved words
3
Literals in Python
Data or constant value stored in a variable. In
the above example, constant value 15 is stored
in a variable a. 15, here is literal. 15 is
integer value so it is also called integer
literal. Python supports different type of
literals- Numeric Literals. Boolean Literals.
Special Literal. String Literals.
4
Identifiers in Python
A name given to a variable, function, class or
object. Never use reserved words as
identifier. Identifier starting and ending with
- Language is defined as special
identifier. Identifier should not start with a
number.
Allowed Characters
Not Allowed
Numbers - 0-9 Underscore - (_) Alphabets
Capital(A to Z) and small (a to z)
Special Symbols are not allowed - (,,_at_)
5
Variables in Python
A variable in python is a name which may change
the data associated with it over time in a
program as and when required. Rules to define a
variable is same as that of an identifier. It
is just a name which is used to create a
reference for the data or object associated with
in a given program. Variable always refers to
the memory location in heap where the data
associated with it is stored.
6
Constants in Python
A constant value is similar to variable with one
exception that it cannot be changed once it is
set. In Python, You may change the value
associated with a constant. Constants in Python
should use only capital letter. Do not use generi
c name like NUM, you may use MAX_NUM or MIN_NUM.
7
Topics for next Post
  • Components of python program Data Types in
    Python
  • Mutable vs Immutable Data type in Python
  • Stay Tuned with
Write a Comment
User Comments (0)
About PowerShow.com