0% found this document useful (0 votes)
9 views12 pages

Syntax Variable

syntax are in programming

Uploaded by

luckybabu036
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views12 pages

Syntax Variable

syntax are in programming

Uploaded by

luckybabu036
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

pantechelearning

PYTHON PROGRAMMING

syntax and
variable
20
23

www.pantechelearning.com
intendation
tab initialize the block of code

comments
# comments are ignored by the interpreter during
the execution of the program.

Multiline statements
/ he line continuation character (\) to split a
statement into multiple lines.

basic syntax
Quotation
'' used to create string object in Python

www.pantechelearning.com
Indentation
indentation refer to the spaces at
tab
the beginning of the code line

python indentation is a way of


telling a python intrepreter that
the group of belongs to a
particular block of code.

www.pantechelearning.com
Importance of
Indicate the start and end of code blocks in python .
indentation
In other programming languages where curly braces {} or
other symbols are used to indicate the start and end of a
code block.

Standard indentation level: 4 spaces

Incorrect indentation can lead to Indentation Error in the


code.

www.pantechelearning.com
comments
Comment start with a "#", and
#
python will render the rest of the
line a comment.

For multi-line comments, the


comments can be mentioned
between """______"""

www.pantechelearning.com
Multiline Statement
line continuation character (\) to
\
denote the line should continue.

Statement contains with in [],(),{}


brackets do not need to use the
line continuation character

www.pantechelearning.com
Quotation
"" Python accept (‘),(“) and(“””)
quotes to denote strings
and multi lines

www.pantechelearning.com
Variable

www.pantechelearning.com
VARIABLE
Variables are containers for
storing data values
Variable The value stored in a variable
can be of any data type

To create a variable in Python, you


simply need to assign a value to a
name using the assignment operator
(=)

Can be accessed and modified by


referring to its name

Quotation
used to create string object in Python

www.pantechelearning.com
Rules for variable

variable names in Python have to start with a letter or an underscore

They cannot start with a number

They can't contain any special characters other than an underscore

Variable names are case-sensitive (age, Age and AGE are three
different variables)

www.pantechelearning.com
pantechelearning

Contact me for
us
89255 33484 [email protected]

www.pantechelearning.com

You might also like