filmov
tv
Machine Learning Tutorial Python : 4. Python Identifiers and Keywords

Показать описание
#vision2020 #aiforeveryone #pythonnumpy :
"My Vision is to provide "AIFOREVERYONE", by creating free video courses for Artificial Intelligence ,
Machine Learning, Deep Learning and Data Science Aspirants!"
If you wish to support my #vision2020, kindly Like, Subscribe & Share this knowledge to your friends and colleagues.
Follow Me :
************************************************************
Playlist:
***********************************************************
Python for Beginners - This video explains about the overview of Python Identifiers and Reserved Keywords
Note: Use HD view for clear text visible
*****************************************
Agenda :
Creating Python 3 NoteBook
Creating Documentation in Jupyter NoteBook
Python Identifiers
Rules for Identifiers
Code Implementation of Identifier
Reserved Keywords
Code Implementation of Reserved Keywords
Recap and Materials Location
*****************************************
Python Identifiers
A Python identifier is a name used to identify a variable, function, class, module or other object.
(OR)
A name in Python program is called as Identifier. Which can be used for Identification purpose like variable, function, class ,module soon on.
Rules for Identifiers
An identifier is a sequence of letters such as uppercase(A to Z),lowercase(a to z),digits(0 to 9) and an underscore (_) ie “Alphanumeric “ characters.
It does not allow punctuation characters such as @, $, and % within identifiers
It is a case sensitive ( Eg: Students and student are different identifiers)
It cannot start with a digit. (Python thinks it is a number) Eg: 1student is invalid
student1 is valid
Reserved words cannot be used as identifiers.
# Find the list of names which suits the rules
# Rule 1 Example : Valid Identifiers
employeename
EMPLOYEENAME
employeeNAME
employee_Name
employee1
# Rule 2 - Invalid Identifiers
employeename@
employeename$
employeename%
# Rule 3 - Case Sensitive - Student and student are different identifiers
Student = "Vinoth"
student = "Anand"
print(Student)
print(student)
# Rule 4 - It cannot start with a digit - Invalid
1Employee
# Rule 5 - Reserved words cannot be used as identifiers.
if = ""
while = ""
Reserved words(Keywords)
Definition : In python some words are reserved to represent some meanings or functionality. Such type of words are called reserved words
Rules for Reserved words
All the Python keywords must be in lowercase letters only.
It Cannot use them as constant or variable or any other identifier names.
# Program to print all the keywords
import keyword
# Total count of the keywords
# Note - Till the previous version the totaly number of keyword is 33.
# Now 'async', 'await' are considered as new keywords in the python.
# Total count is 33 + 2 = 35
['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']
35
************************************************************
Kindly let me know your feedback for improvement purpose. Feel free to correct any mistakes in case !!
Happy Learning,
Vinoth Rathinam
"My Vision is to provide "AIFOREVERYONE", by creating free video courses for Artificial Intelligence ,
Machine Learning, Deep Learning and Data Science Aspirants!"
If you wish to support my #vision2020, kindly Like, Subscribe & Share this knowledge to your friends and colleagues.
Follow Me :
************************************************************
Playlist:
***********************************************************
Python for Beginners - This video explains about the overview of Python Identifiers and Reserved Keywords
Note: Use HD view for clear text visible
*****************************************
Agenda :
Creating Python 3 NoteBook
Creating Documentation in Jupyter NoteBook
Python Identifiers
Rules for Identifiers
Code Implementation of Identifier
Reserved Keywords
Code Implementation of Reserved Keywords
Recap and Materials Location
*****************************************
Python Identifiers
A Python identifier is a name used to identify a variable, function, class, module or other object.
(OR)
A name in Python program is called as Identifier. Which can be used for Identification purpose like variable, function, class ,module soon on.
Rules for Identifiers
An identifier is a sequence of letters such as uppercase(A to Z),lowercase(a to z),digits(0 to 9) and an underscore (_) ie “Alphanumeric “ characters.
It does not allow punctuation characters such as @, $, and % within identifiers
It is a case sensitive ( Eg: Students and student are different identifiers)
It cannot start with a digit. (Python thinks it is a number) Eg: 1student is invalid
student1 is valid
Reserved words cannot be used as identifiers.
# Find the list of names which suits the rules
# Rule 1 Example : Valid Identifiers
employeename
EMPLOYEENAME
employeeNAME
employee_Name
employee1
# Rule 2 - Invalid Identifiers
employeename@
employeename$
employeename%
# Rule 3 - Case Sensitive - Student and student are different identifiers
Student = "Vinoth"
student = "Anand"
print(Student)
print(student)
# Rule 4 - It cannot start with a digit - Invalid
1Employee
# Rule 5 - Reserved words cannot be used as identifiers.
if = ""
while = ""
Reserved words(Keywords)
Definition : In python some words are reserved to represent some meanings or functionality. Such type of words are called reserved words
Rules for Reserved words
All the Python keywords must be in lowercase letters only.
It Cannot use them as constant or variable or any other identifier names.
# Program to print all the keywords
import keyword
# Total count of the keywords
# Note - Till the previous version the totaly number of keyword is 33.
# Now 'async', 'await' are considered as new keywords in the python.
# Total count is 33 + 2 = 35
['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']
35
************************************************************
Kindly let me know your feedback for improvement purpose. Feel free to correct any mistakes in case !!
Happy Learning,
Vinoth Rathinam
Комментарии