So far we discussed
1.
How to write and execute a python program
Today we are going to discuss the following topics are:
1.
Identifier
2.
Reserved Words
Identifier or User-defined word:
The word defined by the user is called a user-defined word or identifier.
Identifier has no meaning.
Identifiers are used for :
Variable names, function names, class names, files, object.
Rules:
1. 1st character must be the alphabet
2. No special characters are allowed
3. No reserved words are used
4. It can be an upper case letter or lower case letter.
5. Identifers are case sensitive
Ex:
A=10
a=20
123abc=10 #error
_123=10 #ok
cash=100 #ok
ca$h=100 #error bcoz $ (special char)
total=100
TOTAL=200
p.v.narasimha.rao=90 #error
p_v=90#ok
Valid
|
Invalid
|
Sum123
|
123sum
|
FOR=10
|
for=10
|
Example:
>>>123abc=10 #SyntaxError: invalid syntax
>>> abc123=10 #OK
>>> print(abc123)
OUTPUT:
10
Next Topic: Reserved word
Previous topic: How to write and execute Python programYou may like the following posts:
Other tutorials
ReplyDeleteThank you for sharing wonderful information with us to get some idea about that content.
Python Training in Hyderabad
Python Training
Python Online Training