0% found this document useful (0 votes)
41 views2 pages

Class 4 Indetifiers and Reserved Words

Python has had 3 major versions released: version 1.0 in 1994, version 2.0 in 2000, and version 3.0 in 2008. The current versions are Python 3.9.5 and Python 2.7.13. Python can be used for developing desktop apps, web apps, database apps, network programming, games, data analysis, machine learning, AI, and IoT. Identifiers in Python include variables, classes, functions, and modules, and they must follow certain naming rules. There are 35 reserved words in Python that cannot be used as identifier names.

Uploaded by

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

Class 4 Indetifiers and Reserved Words

Python has had 3 major versions released: version 1.0 in 1994, version 2.0 in 2000, and version 3.0 in 2008. The current versions are Python 3.9.5 and Python 2.7.13. Python can be used for developing desktop apps, web apps, database apps, network programming, games, data analysis, machine learning, AI, and IoT. Identifiers in Python include variables, classes, functions, and modules, and they must follow certain naming rules. There are 35 reserved words in Python that cannot be used as identifier names.

Uploaded by

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

python version:-

python 1.0v introduced in jan 1994


python 2.0v introduced in oct 2000
python 3.0v introduced in dec 2008

current version

python 3.9.5 pyton 2.7.13

1.For developing Desktop application.


2.For developing web app.
3.For developing database app.
4.For Network programming.
5.For developing games.
6.Fotr Data analysis application and data science.
7.For machine learning.
8.For AI(Artificial Inteligence) app.
9.Fot IOT(Internet of things)

Limitation of python.

Identifiers

A name in python program is called identifiers.


It can be class name or function name or module name or variable name.

a = 10

class BankingProject:

def system_config:

Rules to define identifiers in python:-

1. The only allowed characters in python are

i. alphabet symbols(either lower case or upper case)


ii. digits(0 to 9)
iii. underscore symbol(_)

2.Indentifiers should not starts with digit

total123=(correct)
123total =(wrong)

3.Indentifiers are case sensitive . of course python lang. is case sesitive lang.

total = 10
TOTAL = 99
print(total)#10
print(TOTAL)#99

4.Dollar($) symbol is not allowed in python.

5.There is no length limit python indentifiers,but not recommended to use too


lengthy indentifiers.
6. using underscore symbols:-

x = 10 (normal variable)
_x = 10(procted variable)
__x = 10 (private variable)
___x = 10 (magic variable)

Reserved words or keywords

In python some words are reserved to represent some meaning or functionality. such
type of words are called Reserved words. There are 35 words are reserved in python.

'False', 'None', 'True','and', 'as', 'assert', 'async', 'await', 'break', 'class',


'continue', 'def', 'del', 'elif', 'else', 'except', 'finally', 'for', 'from',
'global', 'if', 'import', 'in', 'is', 'lambda', 'nonlocal', 'not', 'or', 'pass',
'raise', 'return', 'try', 'while', 'with', 'yield'

Note:-
1.we can not use variable or class or function or module name as a keywords name.

ex:-True = 10(worng)'
2.All Reserved words in python contain only alphabet symbols.

3.Excepts the True,False,None 3 reserved words ,all contains only lower case
alphabets symbols.

process of keywords

import keyword
keyword.kwlist

'False', 'None', 'True','and', 'as', 'assert', 'async', 'await', 'break', 'class',


'continue', 'def', 'del', 'elif', 'else', 'except', 'finally', 'for', 'from',
'global', 'if', 'import', 'in', 'is', 'lambda', 'nonlocal', 'not', 'or', 'pass',
'raise', 'return', 'try', 'while', 'with', 'yield'

You might also like