Primitive Datatypes ==================== ==> All python fundamental datatypes are "primitive datatypes" Ex: Registration form: First name:String Last Name:String Suggested Name:String Mobile:Integer Email:string Age: Integer Address: Number with text Current Job Role: String Job Role Category: String Current Salary:Float ==> Classified into three types: 1) Number Type ==> deals with numerals 2) Boolean Type ==> deals with non-numerals 3) String Type ==> deals with text 1) Number Type ============== ==> again classified into three types: 1) Integer Type ==> class: int 2) Floating-point type ==> class: float 3) Complex Type ==> class: complex Note: ==== Python is an Object Oriented Programming Language. Because it can support and Implement all the OOPs principles. OOPs (Object Oriented Programming System) Principles: Encapsulation Polymorphism Inheritance Abstraction OOPs Concepts: class, object, method, constructor etc. ==> Any definition within the program is an object. ==> Object is a reference to the class. ==> Class ==> Blueprint which can be grouped into variables and methods ==> for every datatype in python there is a pre-defined or built-in class. class Person: def __init__(self,fillName,personAge): self.userName = fillName self.age = personAge # print(userName) # print(age) person1 = Person("Ravi",30) # first object print(person1.userName) print(person1.age) person2 = Person("Gopika",24) print(person2.userName) print(person2.age) 1) Integer Type ================ ==> pre-defined class: int ==> using type(), we can get the class name of any data definition. ==> the integer data can be defined in 4-ways: 1) Decimal format ================= ==> Base-10 number format (0 to 9) Ex: 98756123 Ex: 1234 ==> one thousand two hundred and thirty four 1 X 1000 + 2 X 100 + 3 X 10 + 4 X 1 4 ==> 1's place 3 ==> 10's place 2 ==> 100's place 1 ==> 1000's place 4 X 10 ==> 40 40 X 10 ==> 400 ==> Any integer definition, by default considered as "Decimal type" by PVM (Python Virtual Machine). 2) Binary Format ================ ==> base-2 number system ==> define with two literals: 0 and 1 Ex: 1001, 1101 etc. ==> to instruct that a given number as binary not as a decimal: the given definition must be prefix with "0B" or "0b". Ex: 0b11001101, 0B10101011 ==> Binary 3) Octal Format =============== ==> base-8 number system ==> define with 8 literals: 0 to 7 ==> octal data can always prefix with: 0O/0o Ex: 0o1765, 0O1234 ==> Valid octals 4) Hexadecimal Format ====================== ==> base-16 number define with 16-literals 0 to 9 (decimal literals) A to F or a to f (Alphabets) base-16 ==> we need to 16 literals 0 to 15 0 to 9 and 10, 11, 12, 13,14, 15 0 to 9 and a/A, b/B, c/C, d/D, e/E, f/F ==> Alpha numeric ==> with the prefix of "0X" or "0x" a = 8977029779 # decimal base-10 b = 100 # decimal c = 0B10101 # binary base-2 d = 0O1765 # Octal e = 1765 # Decimal f = 0Xaf1234 # Hexadecimal print(type(a)) print(type(b)) print(type(c)) print(a) print(b) print(c) print(d) print(e) print(f)