0% found this document useful (0 votes)
4 views26 pages

Python - Keywords - Identifiers

fjsenfkengklesmfklemesklmglsemsdklflmsdklmsklmsklmslkmsklmsdklgmmdsklgmsdklgmdsmkgsmdskdskmsdkmggggg

Uploaded by

rohi2767
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)
4 views26 pages

Python - Keywords - Identifiers

fjsenfkengklesmfklemesklmglsemsdklflmsdklmsklmsklmslkmsklmsdklgmmdsklgmsdklgmdsmkgsmdskdskmsdkmggggg

Uploaded by

rohi2767
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/ 26

Python Suresh Techs

Suresh techs

Keywords & Identifiers


Suresh techs – Technology and Entertainment

Subscribe Doubts
Suresh Techs
Subscribe: You don’t miss our Follow In Instagram
future videos #sureshtechs
• Link in the description
• Clear your doubts chatting with me
Keywords
• Key + words

• నీ పేరు ఏంటి? RESERVED


Suresh Techs
• అన్నం తిన్ననరా
Keywords are the words that
are reserved

You can’t use them for


variables, classes, functions
Keywords etc
Suresh Techs

Keywords are case sensitive


• help()
KEYWORDS – • Keywords – 35
IDLE • Case sensitive

Suresh Techs
Identifier
• Identify

Suresh Hareesh
Suresh Techs

Jayanth
Identifiers
• Identifier is the name given to identify a variable, class, function etc

Suresh Techs
Case sensitive
• sum = 10
• Sum = 100
• print(sum)
Suresh Techs
Rules for writing Identifiers
• Mandatory:
• Case sensitive: num1, Num1 both are different
• Can be combination of uppercase, lowercase, digits, or underscore(_)
• An Identifier cannot start with digit
• Don’t use special symbols: @,Suresh
!, #, % etcTechs
• Can be of any length
Identify keywords in this program

Suresh Techs
Note:
• Just remember that we have keywords and identifiers

Suresh Techs
Keywords are the words that
are reserved

You can’t use them for


variables, classes, functions
Keywords etc
Suresh Techs

Keywords are case sensitive


Identifiers
• Identifier is the name given to identify a variable, class, function etc

Suresh Techs
What next?
• Statements
• Indentation
• Comments
Suresh Techs
Suresh Techs
Rules for writing Identifiers
• Good to use:
• Class names start with uppercase letter. All other identifiers starts with
lowercase letter
• Starting an identifier with single leading underscore indicates the identifier is
private Suresh Techs
• If the identifier starts and ends with two underscores, that identifier is
language-defined special name
• keyword library – ( import keyword )
• keyword.kwlist
• keyword.iskeyword(string)

keywrods.py Suresh Techs


Few keywords - practical
• Boolean – True, False
• True and False are same as 1 and 0 in python

Suresh Techs
and
Subscribed ( S ) Followed ( F ) LOVE YOU ( L )

True True True

True False False

Suresh Techs
False True False

False False False

Note: Returns the first False value, if not found returns last
Suresh Techs
or
Subscribed ( S ) Followed ( F ) LOVE YOU ( L )

True True True

True False True

Suresh Techs
False True True

False False False

Note: Returns the first True value, if not found returns last
Suresh Techs
Interview - Important

Suresh Techs

The expression x and y first evaluates x; if x is false, its value is returned; otherwise, y is evaluated, and the
resulting value is returned.

The expression x or y first evaluates x; if x is true, its value is returned; otherwise, y is evaluated, and the
resulting value is returned.
Note
• The expression x and y first evaluates x; if x is false, its value is
returned; otherwise, y is evaluated, and the resulting value is
returned.
Suresh Techs
• The expression x or y first evaluates x; if x is true, its value is returned;
otherwise, y is evaluated, and the resulting value is returned.
not (inverts)

subscribed not subscribed


True False

False True
Suresh Techs
Many more keywords
• We will learn them slowly when time comes

• కళ్యాణం వచ్చిన్న కకకు వచ్చిన్న ఆగదంటారు


Suresh Techs

You might also like