Components of a python program (part 3) - PowerPoint PPT Presentation

About This Presentation
Title:

Components of a python program (part 3)

Description:

This presentation informs you on the Python programme components by discussing Expressions in Python and its operators with token, Escape sequence in python. – PowerPoint PPT presentation

Number of Views:8

less

Transcript and Presenter's Notes

Title: Components of a python program (part 3)


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
Expressions in Python
An expression is a combination of values,
variables, operators and call-to-functions. Expr
essions 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-
Token
Operator
add subtract multiply power Integer Division
remainder decorator

-
/ _at_
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. 2. 3. 4. 5. 6.
write a single line string into multi line string
To print \ new line Horizontal tab Vertical tab
\\ \n \t \v
7
Topics for next Post
Data Types in Python Mutable vs Immutable Data
type in Python Stay Tuned with
Write a Comment
User Comments (0)
About PowerShow.com