1 / 7

Components of a Python Program

This presentation informs you on the Python programme components by discussing Expressions in Python and its operators with token, Escape sequence 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. Expressions in Python An expression is a combination of values, variables, operators and call-to-functions. Expressions need to be evaluated. If you use print function for an expression then it evaluates the expressions and prints the result. Expression generally evaluates to a value, which is why expression is written on the right hand side in an assignment statement. A single value itself is a simple expression.

  4. How to create an expression? Python expressions only contain identifiers, literals, and operators. some of those operators are:- Operator Token add + subtract - multiply * power ** Integer Division / remainder % decorator @

  5. Escape sequence in python An escape sequence consists of a special character, such as backslash(), followed by a required character. Whitespace is represented by these characters. Whitespace gives characters like space, tab, formfeed, vertical tab.

  6. Escape sequence in python Few important escape sequences are mentioned as below:- Escape sequence Escape sequence 1. \ write a single line string 2. into multi line string 3. \\ To print \ 4. \n new line 5. \t Horizontal tab 6. \v Vertical tab

  7. Topics for next Post Data Types in Python Mutable vs Immutable Data type in Python Stay Tuned with

More Related