Python Syntax: ============== Syntax: ======= ==> set of rules/guidelines used to develop the application/software/program is called as "Syntax". Keywords: ========= ==> High level programming language Programming languages: 2-types: 1) Low level 2) High level ==> the instructions for the computer can be write in 1's and 0's such a language is called "low level programming language". Ex: for sum of two numbers 123 ==> 1010100101 131 ==> 10101010100101010 semi-colon full stop ==> as a human, handling and/or maintaining low level languages is difficult. Ex: Python ==> write binary code P, y, t, h, o, n Ex: 2-developers X-application Section-1 Section-2 ========= ========== 10 features 10 features Win32 OS Linux32 OS Platforms ==> different Binary code for platform to platform ==> differ. ==> To overcome the drawbacks of low level programming languages, high level programming languages introduced. ==> The instructions to the computer completely with user understandable words such a language is called "High level languages". Ex: C, C++, Python etc. ==> Keywords ==> Reserved words/Pre-defined words have defined with specific functionality. ==> we have total 35-keywords ==> Python keywords have defined in python library with a module name "keywords". ==> when we want to display all keywords of python, we should import this module into our python file. Syntax: import keywords ==> In keywords module, all keywords are represented with a name/reference "kwlist". Comments: ========= Program file: 2-parts 1) Executable part ==> can give us an output 2) Non-Executable part ==> cannot give an output. called as "Comments" ==> majorly used for improving the readability. ==> comments possible in two ways: 1) Single line comments ==> start # 2) Multi line comments ==> """ """ # Write a script using python to display all keywords. """ Here, for this script: we should import a module of python library named as "keyword" """ import keyword # executable statement """ we should specify the reference for identifying all keywords of python keyword module. and store those keywords into separate variable. """ python_keywords = keyword.kwlist # Executable statement # print that separate variable to get all keywords on screen. print(python_keywords) # Executable statement Output: ======= ['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: ==== Python is Case Sensitive language total cases for text representation are: lower case upper case title case capitalize case camel case etc. Ex: text ==> "python is awesome" (lower case) "PYTHON IS AWESOME" (upper case) "Python is awesome" (Title case) "Python Is Awesome" (Capitalize case) "python Is Awesome" (Camel case) ========================================================= id(): ==== ==> to get the address location of our data definition, we can use "id()" Syntax: id(data) print(id("python is awesome")) # lower case print(id("PYTHON IS AWESOME")) # Upper Case print(id("Python is awesome")) # title case print(id("Python Is Awesome")) # Capitalize case print(id("python Is Awesome")) # camel case