Python Identifiers
Python Identifiers:
======================
Hello Friends Welcome Back,In this session i will discuss about the basic concept
related to python ,identifiers
What is identifier?
=======================
Before learning any programming language we should know the basic rules like
how to name variables,functions,classes etc thats where identifiers concept will
come into picture
Identifier:
=================
1)A Name in Python Program is called identifier.
2)it can be class name,variable name,function name,method name etc
Rules to define identifiers:
==================================
1)Identifiers contains only alphabets(lowercase and uppercase),digits(0-9),
underscore symbol (_)
Note:apart from above mentioned indentifier rule if we are using any other symbols
then we will get error immediately
I Guess you noted the error because of dollar sumbol
lets see another example
Now its clear that we should use only the symbols and charcters defined in rule-1
fine lets go to rule-2
2)identifier cannot start with digit
lets see the example
3)keywords cannot be used as identifiers
yes because every programming language have keywords ,keywords means reserved words
which have special meaning in programming language such type of words are called
as keywords or reserved words
i hope you understood keyword
lets look at the example
4)there is no length limit to define identifiers ,it means you can take identifiers
of any length ,looks fine but not recommended to use because it is not in readable
way it is always recommended to define identifiers in readable way ,and it is a
good programming preactice
last but not least about case sensitive feature of python identifiers
5)python identifiers are case sensitive ,it means we can differentiate identifiers
based on their cases
lets take one example
Thank You Very Much In the next session we will see about keywords .
catch you in next session .........................
'''
firstName='raj'
firstname='raj Prudhvi'
print(firstName)
print(firstname)
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa=900
print(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
# if=90
# #here if is a keyword and cannot be used as identifier
# name='raj' #valid identifer
# name123='prudhvi raj'#valid identifier
# employee_name='raj prudhvi'#valid identifier
# # employee$salary=64333.3563
# # employee@email='raj@gmail.com'
# #123salary=890000.5252
Видео Python Identifiers автора Питоновский взрыв технологий
Видео Python Identifiers автора Питоновский взрыв технологий
Информация
3 декабря 2023 г. 16:49:43
00:14:48
Похожие видео