1 / 7

Components of a Python Program

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

Download Presentation

Components of a Python Program

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Components of Python Program Swipe

  2. Components of Python Program Components of any Python Program are as below:- Literals Suite Constants Comments Identifiers Python Statement 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 - ($,#,@)

  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 generic 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

More Related