Python Syntax: ============== Identifier ========== a = 10 a = 20 a = 30 print(a) print(a+a+a) a = 10 b = 20 c = 30 print(a+b+c) ==> Identifier is a name which it can use to identify elements in a program. ==> elements in a program: variable, function, method, class, object, module etc. ==> Identifier can be used to identify the python program elements uniquely. Identifier Rules/Naming Conventions: ==================================== 1) Identifier should always define with: alphabets, digits and underscore sign only. Note: If an identifier with all digits ==> is invalid 2) Identifier should always start/begin with either alphabet or underscore only. a = 123 a_123 = 231 a123 = 231 _123a_b = 120 print(a) print(a_123) print(a123) print(100 == 100) print(123 == 100) print(_123a_b) 3) No keyword as an identifier. 4) Python identifier is case sensitive. # def = 123 Def = 123.234 DEF = 123 # print(def) print(Def) print(DEF) Types of Errors: ================ Error ==> can interrupt the program it can give immediate termination from the execution without result. ==> three types of errors: 1) Syntax Errors/Programmer mistakes 2) Run time errors/Exception # script # login success or fail username = input("Enter Username:") password = int(input("Enter password:")) if username == 'Admin2024' and password == 2024: print("Login Success") else: print("Login fail") 3) Logical Errors ================== def depositAmount(amount,accountNumber): balance = 1234.00 if accountNumber == "AC57360201000": balance = balance * amount # 11234.00 print("My Balance = ",balance) depositAmount(10000,"AC57360201000") ================================================ Variable ======== ==> is a name/identifier which can use to store values ==> variable is simply specified as "named memory". ==> can also specify as "container" ==> Python is dynamically typed language. High level Programming languages: ================================= ==> categorized into three types: 1) Statically typed =================== ==> based on the type of the variable the value assignment can be get rounded-off. Ex: C Language 2) Strongly typed: ================== ==> based on the type of variable, the value assignment should be. Ex: Java 3) Dynamically typed ===================== ==> For this type, no need to define the type of the data/variable at definition time. ==> The python can automatically detect/read the type of the value for the variable, because python is dynamically typed. a = 123 b = True c = "Text" print(type(a)) print(type(b)) print(type(c))