FIRST PYTHON PROGRAM ===================== CODE EDITORS: NOTEPAD/NOTEPAD++ PYCHARM, VS CODE ETC. PYTHON PROGRAM IN NOTEPAD: ========================== 1) Create a notepad file with some title Ex: file-name.py.txt 2) After creating the text file: we can write python code 3) we should convert the text file to python file (by removing the .txt extension from the file) 4) to run the python file: i) open the cmd ii) cd file_location iii) python file-name.py PYTHON WITH PYCHARM: ==================== 1) Create the Python project: ============================== Open the PyCharm go to Mainmenu click file new project enter the title for the project click on "create" 2) Add the sub-folder ===================== Select the project folder right click of the mouse click on new click on directory enter the title ==================================== IDENTIFIERS =========== ==> A NAME USED TO NAME THE ENTITY/ELEMENT IN THE PROGRAM VARIABLE, CLASS, FUNCTION, OBJECT ETC. NAMING CONVENTIONS: =================== 1) SHOULD DEFINE WITH: ALPHABETS: UPPER CASE LOWER CASE DIGITS (0 TO 9) ONLY ONE SPECIAL CHARACTER (_) ex: a = 10 b_1 = 12 c@d = 21 ==> incorrect 2) Should not start with the digit. 9abc = 123 ==> Invalid 3) But the identifier can start with alphabet or underscore sign. 4) KEYWORDS NEVER BE AS AN IDENTIFIER. 5) CASE SENSITIVE. 6) NO LIMIT WITH LENGTH. a = 10 b_2 = 20 # c@d = 30 # 9abc = 121 _1a = 1122 # import = 10 Import = 123 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = 1234 print(a) Keywords: ========= ==> 35-keywords ==> Reserved/pre-defined word having pre-defined meaning for performing the fixed and specific action ex: for ==> looping, if ==> selection etc. Q: WAP IN PYTHON TO DISPLAY ALL THE KEYWORDS. ============================================== import keyword result = keyword.kwlist print(result) ['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'] ================================================= VARIABLE ======== Named memory can use to store the data ==> Dynamically Typed Language Syntax: Identifier = value How to say the python is Dynamically Typed? =========================================== type(): ====== used to know the type of the data/value of variable. Syntax: type(identifier) print(): ======= used to print/write anything on the screen Syntax: print(anything) a = 10 b = 12.23 c = True d = 'study' print(type(a)) print(type(b)) print(type(c)) print(type(d)) ============================================== DATATYPES ========== ==> The type of the data for the variable to store. ==> Two types: 1) Primitive Datatypes ======================= can allow to define the variable with single value. 1) Numerical Type Integer Floating-Point Complex 2) Non-Numerical Type Boolean Type 2) Collection Datatypes ======================= can allow to define the variable with more than one value ex: x = 1,2,3,4 =============================================== Website: https://www.ashokit.in/home Free Python Training 📅 Start Date : Today (04-Nov-2024) ⏰ Class Time: 08:00 PM (IST) ✍️ Zoom Link : https://bit.ly/3Yj8eXe 🔥 For Python BackupVideos (599 INR) : https://rzp.io/rzp/4YMKic7 👉 Join in Our WhatsApp Channel : https://bit.ly/49wCWje