70 likes | 81 Views
This presentation informs you on the Python programme components by discussing Expressions in Python and its operators with token, Escape sequence in python.
E N D
Components of Python Program Swipe
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
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.
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 @
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.
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
Topics for next Post Data Types in Python Mutable vs Immutable Data type in Python Stay Tuned with