{"id":24326653,"url":"https://github.com/pratikrameshmajage/python","last_synced_at":"2025-03-11T06:23:36.465Z","repository":{"id":271749116,"uuid":"914426174","full_name":"PratikRameshMajage/Python","owner":"PratikRameshMajage","description":"Learning Python Programming 🐍💻 Python is a versatile and beginner-friendly programming language that opens doors to endless possibilities! 🌟 Whether you're diving into web development 🌐, data science 📊, machine learning 🤖, or automation ⚙️, Python has something for everyone.","archived":false,"fork":false,"pushed_at":"2025-02-15T17:38:10.000Z","size":5006,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-15T18:31:45.363Z","etag":null,"topics":["class","identation","library","pvm","syntax"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PratikRameshMajage.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-09T15:18:10.000Z","updated_at":"2025-02-15T17:38:13.000Z","dependencies_parsed_at":"2025-01-28T04:24:27.475Z","dependency_job_id":"8cdd0a5c-35c6-449c-aa90-9f09f8234afd","html_url":"https://github.com/PratikRameshMajage/Python","commit_stats":null,"previous_names":["pratikrameshmajage/python"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PratikRameshMajage%2FPython","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PratikRameshMajage%2FPython/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PratikRameshMajage%2FPython/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PratikRameshMajage%2FPython/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PratikRameshMajage","download_url":"https://codeload.github.com/PratikRameshMajage/Python/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242982429,"owners_count":20216602,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["class","identation","library","pvm","syntax"],"created_at":"2025-01-17T21:13:47.095Z","updated_at":"2025-03-11T06:23:36.438Z","avatar_url":"https://github.com/PratikRameshMajage.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `Python` `V25.01.08`\n## `Notes:`\n- `Guido van Rossum` Inventer of `Python` - `Monty Python's Flying Circus`. `Python came into Picture just to help those people who don't know how to write a code`\n- `James Gosling` - Inventer of `Java` - `Oak`\n- `Dennis Ritchie` - Inventer of `C`.\n- `Michael Widenius` - Inventer of `MySql`.\n- `1991` \u0026 `Feb`,  Python came in 1989 so it's way befor java 1995.\n- It is a `case sensitive language`\n- Python can be used for : \n    - `Programming` (for Placements/online contests/DSA)\n    - `Development` (using a backend framework called Django)\n    - `Machine Learning` | `Data Science` | `Articial Intelligence` | `Software Devlopment` | `Web Devlopment` | `Gui`.\n- Websites built using Python include `Google`, `Youtube`, `Instagram`, `Netfix`, `Uber`. `Dropbox`, `Nasa`, `Yahoo`, \u0026 `reddit` written in Python much more.\n- `Python` (https://www.python.org/) It also Called the `General Purpose Language`\n- Python 1.0 - 1994\n- Python 2.0 - 2000 Depricate in 2020\n- Python 3.0 - 2008 New and It has lot of Features \u0026 Library Supports.\n- `PVM` - Python Vertual Machine witten in Assembly language Which use Machine Level Language and convert it into binary language. Do's (Byte Code Verification) Throw Exception when byte code standard's not match.\n- `High Level Language` (HLL) -\u003e Python, English\n- `Low Level Language` (LLL) -\u003e Machine Level Language, Assembly Language-\u003e Registers, Ic's\n- `Binery Language` -\u003e Byte Code -\u003e 0 \u0026 1\n- `Constructive Language` - Create a Server - That's why we can use Python in web -\u003e While \"constructive language\" is not a standard term, it could be used informally to describe Python’s role in building and constructing web applications, as it helps assemble server functionality efficiently.\n- If you're coining a term, you could say \"constructive backend language\" to emphasize Python’s role in creating server-side architectures.\n- `Scripting Language` -\u003e Use in Hacking | Everything Consider as String.(Numbers) | Input consider as a String. Beacouse python is scripting langiage it is use for web devlopment also. \n- `Interpriter Language` (Logical Exception) (Run Time Exception) (Bytecode Verification) -\u003e Checks Byte Code Standards.\n- `Compile Language` (Syntactical Error) (Compile Time Error)\n\u003c!-- - MySql -\u003e YACC -\u003e Yet Only Compile Compile -\u003e C++ and MySql Two Compilers  --\u003e\n- `Robust in Nature` - Memory Management After Code Execution | `Clears Memory After Usage`\n- `Scalable Language` - Compatible to Code with Every Language -\u003e `MySql`, `JavaScript`\n- Install Python:\n    - python --version\n    - pip --version -\u003e python install packages\n- Install jupyter:\n    - jupyter --version\n    - folder -\u003e path -\u003e cmd -\u003e jupyter notebook\n    - browser -\u003e new -\u003e .ipynb -\u003e Interactive Python Notebook -\u003e The notebook provides an environment where you can write and execute code, visualize data, and include `rich text annotations` interactively means `Markdoun annotations`.\n- `Integrated Devlopment Environment:` \u0026 `Debugger`\n    - Here No Need to Create New File\n        - `Jupiter` -\u003e Open Source -\u003e .ipynb -\u003e i : Interactive, py : Python, nb : Notebook.\n        - `Python CLI IDLE` (File will Not Be Save) REPL (Read Evaluate Print Loop) Prompt in Windows, \u0026 Shell in Mac\n    - Here Need to Create New File\n        - `VS Code` -\u003e Microsoft and it is Open Source to Buid Yourself.\n        - `Pycharm` -\u003e JetBrains\n        - `Intellige` -\u003e Java\n- `Advanced Libraries` - Enumration -\u003e: AI \u0026 Ml\n    - Permutation and Combination\n    - Probability\n    - Statistics\n    - `Numpy` - Data Manuplation -\u003e Heavy Focus on Arrays, Nunmerical python.\n    - `Pandas` - Data Operations.\n    - `Matplotlib` - Data Visualisation -\u003e Graphs, , Charts, Ven Diagrams.\n- `print` -\u003e Returns Each Charecter on Console Screen. Except escape charecters like (/n). \n    - Double Coatation \u0026 Single Coatation.\n    - print(\"'Pratik\\'s Birthaday'\")\n    - ( \\ Back Slash) Ignores Special Charecter. eg: print('partik\\'s \"laptop\"')\n- `type` -\u003e Returns Data Type of Data on the console screen. \n- Companie Work on Python: `Infosis python 20%`, java 40%, deops 40%.\n- Difference Between `Function` and `Method` -\u003e Block of Code which Executes Targeted Logic called Normal Function. And Function Use in Class called Method. \n- `( : )` -\u003e `Identation` -\u003e Dependency Code (Indentation)\n- Portable -\u003e Works on Windows|Mac|Linux, Means platform Independent. \n- Implicit Conversion : ByDefault Conversion.\n- Explicite Conversion : We did this By our own Hand.\n- Partial Execution means 50% not 100%.\n- All Progrogramming Languages are Scripting Languages. thats why here by default input value is consider as a string. like Python and JavaScript.\n- Input : It allows to Except value on RunTime. (RunTime Is Class)\n- ByDefault Input Value Accepts String. Beacouse All programing Languages are Scripting languages.  \n- Type Conversion : int(input()) float(input()) complex(input())\n- Every Data Type in python is Class. we are using there Objects eg:\u003c class int \u003e\n- Eveery Exception in python is class. \n- In Python, everything is an object, and every object is an instance of a class. So, when you use the type() function on an object, it returns the type of the object, which is the class to which it belongs.\n```python\nx = 42\nprint(type(x))  # Output: \u003cclass 'int'\u003e\n```\n- x = 42: Here, x is assigned the value 42, which is an integer.\n- type(x): This returns the class of the object x. Since 42 is an integer, type(x) will return \u003cclass 'int'\u003e, indicating that x is an instance of the int class.\n\n- `Compiler:`\n    - It Give's an Error.\n    - Compile Time Error.\n    - Compile at the time of Code Writing.\n    - If it fail's in Compilation process it does not show any Output Gives Direct Syntactical Error.\n- `Interpriter:`\n    - It Throw's Exception.\n    - Run Time Exception.\n    - Interprit at the time of code Execution.\n    - It may be do the Partial Execution after Compilation and then on run time interpritation.\n\n- `Error:`\n    - Occours Beacouse of Syntactical Error.\n    - At the Time of Compilation.\n    - Compile Time Error \n    - Does not Show any type of Output Just Show the Syntax Error. \n- `Exception:`\n    - Occours Beacouse of Logical Errors. \n    - At the Time of Interpritation.\n    - Run Time Exception\n    - It Will Show Partial Output or Exception.\n\n- `Comments:` \n    - Use to Explin the code\n    - Processor does not Execute the Commented line. It Ignores it. \n    - `Types:`\n    - `Single Line Comment:`\n        - It denote by `#` - Hash\n    - `Multiline Comment:`\n        - It denote by `\"\"\"....\"\"\"` - Thriple Cottation\n\n\n- `BODMAS:` `Border: (){}[]` `Order: Square \u0026 Square Root`, ` Divide: / Multiply: *`, `Addition: + Subtraction: -.`\n\n## `Special Charecters in Python:`\n- `Termination ( ; ):` Why Optional? -\u003e In System Libraries(Assembly Language) already /n is available after the print(\"...\"/n) so no need to ( ; ) Terminate Line. \n- `Concatination ( , \u0026 + ):` Join\n    - print(\"Pratik\" + \"Majage\")\n- `New Line ( \\n )` -\u003e go to new line \n- `Row String ( r )` -\u003e  eg: print(r'c:\\docs\\nayan')\n- `Back Slash ( \\ )` -\u003e Ignores Special Charecter. eg: print('partik\\'s \"laptop\"')\n- `Privious Output ( _ )` -\u003e Output of Privious Operation.\n\n## `Variable:`\n- `Variable` -\u003e The Name of Memory Location\n- a = 5\n- id(a) -\u003e get address -\u003e It is use to get the address of variable or memory location.\n- b = a\n- Whenever you create multiple variable and in case if they have Same Data they both will point to the Same Box. they will not be getting multiple boxes for each variable. and that's where python is more memory efficient, right Beacouse youre not getting multiple data here\n\n## `Addvantages:`\n- `Easy to Learn`\n- `Easy to Code`\n- `Interprited Language`\n- `Compile Language`\n- `Scalable Language`\n- `Robust in Nature`\n- `Portable`\n- `Free \u0026 Open Source`\n- `High Level Language`\n- `Large Community Support`\n- `fastest Groing Language - Developers \u0026 Libraries Companies \u0026 Areas ML GUI Soft.D Web.D`\n\n## `Data Types:`\n- `Numerical:`\n    - `Int` (Numbers)\n    - `Float` (Decial Point Value) (Floating Point Representation)\n    - `Complex` (ai+bj) -\u003e Combination of Real and Imaginary Numbers.\n- `Sequential:`\n    - `List []`\n        - Combination of elements of Different Data Types\n        - There is Defferece between List \u0026 Array\n        - List is Mutable.\n        - We can perform certain Operation using Methods.\n    - `Tuple ()`\n        - Ues on large Data.\n        - It take less Memory Space and less Time to Execute. \n        - Tuple is Immutable. We can not ( Do Operations ) Change Once We Defined. \n        - Limited Methods:\n            - count\n            - index\n        - Iteration is Fast than List.\n    - `Set {}`\n        - Collections of Elements of Unique Elements (Same Or Different Data Types).\n        - Never Follow Sequence.\n        - Indexing not Supported.\n        - Not Support Duplicate Values.\n        - Just Return Unique Value. No Duplicasy.\n        - We can perform certain Operation using Methods.\n    - `Frozen Set`\n        - It Use to Create Copy of Original Set.\n    - `Dictionary {}`\n        - Key Value Pair.\n    - `Range ( Start : End )`\n        -     \n- `String:`\n    - Collections of Charecters.\n    - In python Charecter data type does not exist. Only string data type exist.\n    - Charecter (Char) Consider as a String.\n    - In Python any Value consider By Default as a String.  \n    - In a Computer Numbering start from Zero. -\u003e String: collection of charecters in Array indexing start from 0.\n    - left to Right : 0 1 2 3\n    - Right to left : -1 -2 -3 -4\n    - Strings are immutable. we can not change once we assign the value.\n    - len() -\u003e Returns total length of string in int data type.\n- `Boolean:`\n    - True \u0026 False. 1 \u0026 0.\n\n## `Operators:`\n- There are Four types of Operators.\n- `Arithmatic Operator:`\n    - There are `8 Operators in Arithmatic Operators.`\n    - `Addition:( + )`\n        - Do's Addition | Summation.\n        - Symbolis: Plus ( + ).\n        - Minimum 2 Operands and 1 Operator specifically Operator lies within the 2 Operands.\n    - `Subtraction:( - )`\n        - Do's Subtraction.\n        - Symbolis: Minus ( - ).\n        - Minimum 2 Operands and 1 Operator specifically Operator lies within the 2 Operands.\n    - `Multiplication:( * )`\n        - Do's Multiplication \u0026 `Return's Product of two or more Operands`.\n        - Symbolis: Star | Astaric ( * ).\n        - Minimum 2 Operands and 1 Operator specifically Operator lies within the 2 Operands.\n    - `Exponantiol:( ** )`\n        - Do's Exponantional make Power of that Integer.\n        - Symbolis: Two Consicative (Continous) Star | Astaric ( ** ).\n        - Minimum 1 Operand integer and 1 power integer Operand specifically Operator lies within the 2 Operands.        \n    - `Division:( / )`\n        - Do's Division and `return's the Quotient`.\n        - Symbolis: Division ( / ) Forword Slash.\n        - Minimum 2 Operands and 1 Operator specifically Operator lies within the 2 Operands.\n        - Floor Division. Base Integer Value (3.5)-\u003e 3\n        - Sealing Division. Round Integer Value (3.5)-\u003e 4\n    - `Floor Division:( // )` \n        - Do's Division and `return's the Quotient Base Integer Value`.\n        - Symbolis: Division ( // ) `Two Consicative (Continous) Forword Slash`. \n        - Minimum 2 Operands and 1 Operator specifically Operator lies within the 2 Operands.\n        - Also calles as `Integer Division.`\n    - `Modulos:( % )`\n        - Do's Division and `Returns Remainder.`\n        - Symbolis: Percentage ( % ).\n        - Minimum 2 Operands and 1 Operator specifically Operator lies within the 2 Operands.\n    - Assignment Operator:\n        - Store Value in Variable  \n\n- Assignment Arithmatic Operator:\n    - (+=): Addition and Assign to\n    - (-=): Subtraction and Assign to\n    - (*=): Multiplication and Assign to\n    - (**=): Exponantiol and Assign to\n    - (/=): Divide and Assign to\n    - (//=): Floor and Assign to\n    - (%=): Modulo and Assign to\n\n- Relational Operator:\n    - `Relational operator Returns Boolean DataType`. In the form of True and False.\n    - Grater Than:\n        - Open Angular Bracket \n\n    - Less Than:\n        - Close Angular Bracket\n\n    - Greater than Equal To: Min\n        - Open Angular Bracket With Assignment Operator\n        - Given value should be Greater than Equal to the Minimum Value.\n\n    - Less Than Equal To: max\n        - Close Angular Bracket With Assignment Operator.\n        - Given value should be less than Equal to the Maximum Value.\n\n    - Equal To:\n        - Two Consicutive ( Contiguous ) Assignment Operator called Equal to Operator.\n        - Return's True when both are Similar values.\n\n    - Not Equal To: `Not ( ! )`\n        - Exclametory mark with Assignment Operator\n        - Return's True when both are Different values.   \n\n|Assignment Operator            | Equal to Operator             |\n|-------------------------------|-------------------------------|\n|called Assignment Operator     |called Equal to Operator       |\n|Belongs to Arithmatic Operator |Belong to Relational Operator  |\n|It Stores Value                |Compare Values                 |\n\n- Logical Operator:\n    - Returns Boolean Value.\n    - Logical and:\n        - Returns True when all Conditions | Inputs are True.\n    - Logical or:\n        - Returns False when all conditions are False. \n    - Logical not:\n        - Return Negation of Input value. \n    - Logical NAND:\n        -  Not \u0026 And both makes NAND. called Negation of and\n    - Logical NOR:\n        -  Not \u0026 Or both makes NOR. called Negation of or\n\n- `Bitwise Operators:`\n    - It Returns Boolean Value on the Console Screen.\n    - `Binary Concersion :` `| 32 | 16 | 8 | 4  | 2 | 1 |` = `2^5|2^4|2^3|2^2|2^1|2^0`\n    - `Bin() Function` use to Convert an `Integer value` to `Binary Value` also use to `Identity of a binary value.`\n    - `0b` : is use an identifier for Binary Value `Identity.`  \n    - Addition of `1+1` Bitwise Operator is `10` where 1 is Carry and 0 is Remainder.\n    - `Bitwise AND ( \u0026 ):` 1 1 -\u003e 1\n        - It Returns 1 when all Inputs are 1 else it Returns 0.\n    - `Bitwise OR ( | ):` 0 0 -\u003e 0\n        - It Returns 0 when all Inputs are 0 else it Returns 1.\n    - `Bitwise Ex-OR ( ^ ):` 0 0 -\u003e 0 | 1 1 -\u003e 0 | 0 1 -\u003e 1 | 1 0 -\u003e 1 |\n        - It Called Exclusive-Or.\n        - It Returns 0 when all Inputs are Same.\n        - It Returns 1 when all inputs are Different.\n    - `Bitwise Complimentory Operator ( ~ ):` ~1 -\u003e 0\n        - It Returns Complimentory of Input Value. \n        - It Add 1 in in given value.  \n        - It also called as 1'st Compliment Operator. (~4)\n        - It gives Negative Value. ( -5 )\n        - Negation of Negation called as 2's Compiment. (~(~4))\n        - It gives Negative Value. ( -6 )\n    - `Bitwise Left Shift Operator ( \u003c\u003c ):`\n        - Two Consicutive Close Angular Bracket. \n        - In this Operator; Value is Increases.\n        - The Vacant Position after shifting are Occupied by 0. \n        - print(3\u003c\u003c2) \n    - `Bitwise Right Shift Operator ( \u003e\u003e ):`\n        - Two Consicutive Open Angular Bracket.\n        - In this Operator; Value is Reduce.\n        - The Vacant Position after shifting are Occupied by Nothing.\n        - print(3\u003e\u003e2)  \n```python\na = 3\nprint(a)\n# Output : 3\nprint(bin(a)) \n# Output : 0b11\nprint(bin(0b11))\n# Output : 0b11\n```\n- `Membership Operators:`\n    - Returns Boolean Value.\n    - `In:`\n        - It returns True when Specified Data is Present in given Value.\n    - `Not In:`\n        - It returns True when Specified Data is Not Present in given Value.\n    \n- `Identity Operators:`\n    - Returns Boolean Value.\n    - Object : Memory Location.\n    - Mutable : List. Similar Data But Here It Represents by Different (Objects) Memory locations.\n    - Immutabe : String, Tuple By Default in Python. When Similar Data is Present in Variable then it Represents by Same (Object) Memory Location.\n    - All Data Types are Classes in Python.\n    - `Is:`\n        - Compares and Returns Boolean Value.\n        - It Returns True when Specified Data Object and given Data Object is Similar.\n    - `Is Not:`\n        - It Returns True when Specified Data Object and given Data Object is Diffreant.\n    - a=b : Explicit Conversion (we did this by our own hand) thats why it is Consider as Partially Immutable means 50% Immutable not 100%.\n\n## `Control Statements:`\n- It is use to Control the Execution Flow of the code.\n- It Helps in Efficiently Executing Code by Saving Time \u0026 Memory.\n- Control Statement Executes a Prticular Block of Code only when the Condition is True.\n- `if Contrl Statement:`\n    - It is Control Statement.\n    - Declared by Kyword `if`.\n    - if Block\n    - Check Conditions\n    - Efficient -\u003e Save Time and Memory.\n    - Any Positive and Negative Number consider as a True. Truty Value\n    - 0 Consider as a False. Falsy Value\n    - -0 -\u003e Entity: Something that Exist. -\u003e Tecnically Wrong Value. \n    - In Python, the condition if -0 will evaluate to False. Here's why:\n    - Explanation:\n        - In Python, 0 (zero) is considered falsy.\n        - The negative sign before 0 (i.e., -0) does not change its value; -0 is still 0 in Python.\n        - Therefore, if -0: will be treated as if 0:, which evaluates to False.\n    - Syntax:\n```python\nif True:\n    print(\"Welcome!!\")\nif False:\n    print(\"Welcome!!\")\n```\n- `if-else Control Statement:`\n    - Else Block is Specified below if block.\n    - No Conditions are Checked in Else Statement.\n    - It Executes when if Statement is False. \n    - If Else condition is not Declared then it Returns `Blank` Value. means Return's Nothing on Console Screen. \n    - Syntax:\n```python\nif True:\n    print(\"Welcome!!\")\nelse:\n    print(\"Bye..\")\n``` \n- `if-elif Control Statement | if-elif-ladder Control Statement:` \n    - Multiple Conditions are checked in elif Control Statement.\n    - Starts with if Statement can Continue with many elif statements and may or may end with else.\n    - Syntax:\n```python\nif condition 1:\n    # Code|Logic\nelif condition 2:\n    # Code|Logic\nelif condition 3:\n    # Code|Logic\nelse:\n    # Code|Logic\n```  \n- `match Control Statement: | Switch Control Statement`\n    - It is declared by the keyword match.\n    - it Contains many no of cases  each case has label.\n    - Data match with the case label, the case label is Execute.\n    - Case is Declared by the keyword case followed by case label \u0026 identation.\n    - the `Wild Charecter` (_) case charecter executed when the no data matches with case labels.\n    - Syntax:\n```python\nmatch value:\n    case 1:\n        # Code|Logic\n    case 2:\n        # Code|Logic\n    case 3:\n        # Code|Logic\n    case _: # Default Case\n        # Code|Logic\n```\n\n## `Loops:`\n- Repetetion - Iteration\n- Help to Execute Progressively | Repeatedly and with Enhancement.\n- `For Loop`\n    - Use keyword: for\n    - in(Membership Operator)\n    - range() - Predefined Function -\u003e Accept 3 pameters -\u003e Start|end|Difference eg:range(1,6), range(5,0,-1)\n    - for i in range(5,0,-1):\n- `While Loop`\n    - Use for Iteration.\n    - Intialise the variable.\n    - Use keword: while(condition) in brackets we have to give the condition.\n    - Increament|Decreament \n- `break :` `It Terminates the Execution of Code.`\n- `continue :` `Omit the Perticular Situation.` \n      \n## `Function:`\n- It is `Entry or Block of Code` which `Executes Targeted Logic.`\n- It `Identifies` by a `Function Name.`\n- By using `def` keyword.\n- `() : Function`\n- `: -\u003e Dependancy Code (Identation)`\n- Single Python code file has `Multiple Functions.`\n- Function Name should be `Unique.`\n- Function `Defination` - `Parameters`\n- Function expression.\n- Function `call` - `Arguments`\n- `Reusability:` `Write Once Use Multiple Time.`\n- `Function always Jump Upword Direction` thts why `Function call` is `always below the Function Defination.`\n- `return keyword:` `Return the value where the function call.`\n- A value can be use outside the function by using return keyword.\n- We can store the value in new variable by using return keyword.\n- We can use multiple functions in pirnt funcrions.\n    - `Non-Parametrise Functions.`\n    - `Parametrise Functions.`\n        - No of Arguments should match with the No of Parameters.\n        - Separate by Commas\n        - Parameter - Defination\n        - Argument - Call\n- `Ambiguity:` Multiple Functions has Same Name.\n- Priority to Nearest Closest Function.\n- Compatibility : Same Data Types.\n```python\ndef Info():\n    print(\"Hello I.T\")\nInfo()\n```\n## `OOP's: Object Oriented Programming:`\n- `Class:`\n    - class is a keyword to define the Class in Python.\n    - Class is a template of Object also know by Blueprint.\n    - Class is a Container.\n    - Attributes : Variables\n    - Bihaviour : Methods\n    - Class is a Combination of Data Members, Methods.(variables and Methods).\n    - Calss is a collection of set of Multiple Data Members and Member Functions.\n    - Class is a collection of Logic and Modues\n    - class keyword\n    - : - Identation (Indentation)\n    - Follows Camelcase Syntax Structure\n    - To Access Class methods or Variables we need to create class Object means Refrence Variable of calss.\n    - Syntax: class Data:\n\n\n- `Relation between Object and Class:`\n    - `Object is an instance of Class`\n    - `Constructor: Use to Intialize the Object.`\n    - `Object allocates memory by intiallizing class Constructor`\n    - `Object defines the Behaviour of Class`\n    - `class is the container of Data members and Method functions.`\n    - `class is a Blueprint`\n    - `More than one constructor allow in python with diffrent parameters.`\n    - `def keyword use to define Constructor.`\n    - `By using def __init__(self) we create Constructor.`\n    - `self parameter is mendatory for constructor and methods.`\n    - `Constructor does not require object`\n\n- `Methods and Functions:`\n    - `Methods:`\n        - Function inside a class Called Method.\n        - In Python Method Has Copulsury Self Parameter.\n        - () are Mendatory to Methods.\n        - : Identation is Mendatory to Methods\n    - `Function:` \n        - A BLock of Code which Executes Targete Logic called Function. It is Outside the class.\n\n- `Special Method:` \n    - `Constructor:`\n        - Synatx: def __init__(self):\n        - def Keyword is Mendatory to Create a Method. Constructor is also a Method\n        - Self Parameter is Compulsury.\n        - Constructor has 1'st (high) Priority than Method in class. means Higher Priority than Normal Method\n        - Constructor allocates memory to class when object is Created.\n        - By default Call when Object is Creted. (Memory is allocated)\n        - Data() -\u003e Class Constructor. this is how you call a Constructor.\n        - Not Require Refrence Variable (Object).\n\n- `Object:`\n    - By Using Class Constructor It Creates a Memory for Calss is known as Object.\n    - Syntax: obj = Data() | Refrence Variable = Class Constructor.\n    - Referance Variable refers the Memory Location. \n    - By using Object (Referance Variable) we access the calss variables and Methods outside the calss.\n    - Refrence Variable is intermediatery between Method and Memory Location. Method \u003c- Refrence Varible -\u003e Memory Location\n    - Refrence Variable Refers Data Members of Class.\n\n- `Self:`\n    - Self is a Parameter.\n    - Refers to the Current Object.\n    - Points To the Instance Variable.\n    - Self is Use to Deferentiate the Local and Instance Variable.\n    - Self is use to Call the Current Object Method.\n    - Within Class we can call multiple Method from inside the another method.\n    - It make's Processor to jump easily within the calss one method to another method.\n    - jump from 1 method to another method - self keyword. syntax: self.data()\n    - jump from 1 class method to another imediate parent class method use super keyword. - super() keyword. syntax: super().data()\n\n\n- `Instance Variable:`\n    - A Varible within the Calss and outside the Methods called Instance Variable.\n    - If you want to use Instance Varialbe in the Method we need to use self keword. like: self.num1, self.num2\n    - Instance variable accessible outside the class by using the Objects.\n    - The Scope of Instance Variable is within the Class.\n\n- `Local Variables:`\n    - A Variable inside the Method called the Local variable.\n    - The Scope of Local Variable is Within the Method Block.\n    - Parametrise variables are local variables.  \n\n## `Problem Statements:`\n- `Armstrong: 153`\n    - A number whose summation of cube of each digit is the same number is called Armstrong Number.\n    - 153 -\u003e (Cube) 1 ** 3 | 5 ** 3 |3**3 -\u003e (Summation) 1|125|27 -\u003e 153 \n    - Save original value to another variable beacouse it may be chances to change the Original number. -\u003e temp = num\n    - Intialise the sum by 0. -\u003e sum = 0 \n    - Use loop for iteration till condition makes false. -\u003e while(num\u003e0)\n    - Grab Last Digit -\u003e rem = rem % 10\n    - Formula: sum = sum + (rem * rem * rem)\n    - Remove Last Digit = num = num // 10 | num = int(num/10) type cast to integer.\n    - Check the Original number and Armstrong Number by using Ff-Else Condition -\u003e if sum==temp:\n    - If true print sum is Armstrong else print temp is not Armstrong number.  \n\n- `Palindrome: 121`\n    - A number whose Reverce Number is the same Number called Palindrome Number.\n    - 121 -\u003e 121 | 353 -\u003e 353 \n    - Save Number to another Variable. -\u003e temp=num \n    - intialise sum by 0. -\u003e sum = 0\n    - use loop for iteration till condition makes false. -\u003e while(num\u003e0)\n    - Grab Last Digit. -\u003e rem = rem % 10\n    - Formula -\u003e sum = (sum * 10) + rem\n    - Remove Last Degit. -\u003e num = num//10 | num = int(num/10)\n    - Check the Original number and Palindrome Number by using Ff-Else Condition -\u003e if sum==temp:\n    - If true print sum is Palindrome else print temp is not Palindrome number.  \n\n- `Factorial: 5!`\n    - 5! -\u003e (Start fact) 1 * 1 2 3 4 5 -\u003e 120\n    - Take a input range from user.\n    - Intialise fact by 1. -\u003e fact = 1\n    - Use for loop to reach the condition. -\u003e for i in range(1,num+1):\n    - Formula: fact = fact*i\n    - Print Factorial number\n\n- `Fibonacci:`\n    - Addition of Privious two Numbers Called the Fibonacci series. \n    - By Default Start from 0 \u0026 1.\n    - Intialize two variables with 0 and 1. -\u003e p1 = 0, p2 = 1\n    - Take a Range from User by Using Input.\n    - Print privious numbers.\n    - Use for Loop To Iterate. -\u003e For i in range(2 to num)\n    - Start from 2 beacouse we already print privious two values.\n    - Formula: p3 = p1 + p2\n    - Print p3\n    - Swap Values -\u003e p1=p2, p2=p3\n\n## `Lambda:`\n- `Lambda Function:`\n    - It is Anonymous (Unknown) Function. No Function Name.\n    - Declare by the keyword lambda.\n    - It is ShortHand Function (Oneline Function)\n    - It is not use def keyword.\n    - It is Returning Function.\n    - It is Parametrize Function.\n    - Syntax: Variable = Lambda Parameters : Expression\n      \n- `Lambda vs Method:`\n    - `lambda:`\n        - Function is Anonymous.\n        - No use of def keyword.\n        - Always Parametrise and returning function.\n        - Use for simple logic.\n        - Usecase - OneLine Function.\n    - `Method:`\n        - Function Should have Name.\n        - Use def keyword to declare the function.\n        - It may be or may not be Parametrise or Returning Function.\n        - use for Complex logic.\n        - MultiLine Funcion.\n        - Self Parameter is Compulsury.\n          \n- `Constructor vs Method:`\n    - `Constructor:`\n        - Constructor declare by def keyword.\n        - Constructor name is __init__.\n        - Constructor has compulsory self parameter.\n        - It executes Immediately. higher pripity than method.\n        - No need of Refrence Variable.\n        - It cretes memory for class data members. \n    - `Method:`\n        - Function Should have Name.\n        - Use def keyword to declare the function.\n        - It may be or may not be Parametrise or Returning Function.\n        - use for Complex logic.\n        - MultiLine Funcion.\n        - Self Parameter is Compulsury.\n          \n- `Types of Function:`\n    - Normal Function\n    - Method Function: A function declare inside the class called method.\n    - Constructor Function\n    - Parametrise Function: no of Arguments are match with no of Parameters.\n    - Non-Parametrise Function\n    - Returning Function\n    - Lambda Function (Anonymous Function)\n    - Nested Function (Inner Function): Function Declare inside another Function.\n\n## `String:`\n- `String:`\n    - Collection of Charecters called String:\n    - Charecter does not exist in Python. Each Charecter consider as a String.\n      \n- `String \u0026 Functions:`\n    - `Concatination:`\n        - String can be added by Concatination.\n        - a = \"Hi\" | b = \"How are you?\" \n        - print(a+b)\n    - `functions Start from is__ Return Boolean Values:`\n    - `isalnum:`\n        - Return Boolean Value.\n        - Return true when string contains Alphabets and Numbers.\n        - Return false when string contains Special Charecters and Space.\n        - print(data.isalnum())\n    - `isalpha:`\n        - Return Boolean Value.\n        - Return true when string contains Alphabets.\n        - print(data.isalpha())\n    - `islower:`\n        - Return Boolean Value.\n        - Return true when given string is in lowercase.\n        - print(data.islower())\n    - `isupper:`\n        - Return Boolean Value.\n        - Return true when given string is in uppercase.\n        - print(data.isupper())   \n    - `isdigit:`\n        - Return Boolean Value.\n        - Return true when given string is in Numeric Format.\n        - Return false when given string contains space and special charecters.\n        - print(data.isdigit())\n    - `join:`\n        - It mixes the given strings one charecter at a time.\n        - print(s1.join(s2))\n    - `lower:`\n        - convert uppercase to lowercase.\n        - print(s3.lower())\n    - `upper:`\n        - convert lowercase to uppercase.\n        - print(s3.upper())\n    - `swapcase:`\n        - It will Reverce the case value of a given string upper to lower and lower to upper.\n        - print(s3.swapcase())\n    - `title:`\n        - It converts every first letter of each word in capitalcase.\n        - print(s3.title())\n    - `replace:`\n        - Replace function change Old String to New String.\n        - print(s3.replace(\"bad\",\"good\"))\n    - `find:`\n        - Return index Posititon of given String. \n        - Return -1 if not Found\n        - print(s3.find(\"b\"))\n    - `index:`\n        - Return index Posititon of given String.\n        - Return Exception if not Found. Terminate the code. (substring not found)\n        - print(s3.index(\"z\"))\n- `String Functions`             \n    - isalnum\n    - isalpha\n    - isdigit\n    - islower\n    - isupper\n    - Concatination\n    - join\n    - upper\n    - lower\n    - title\n    - swapcase\n    - replace\n    - index\n    - find\n\n## `Format Specifier:`\n- `Format Specifier:`\n    - Format Specifier refers to corresponding Variable in order to reflect the correct value on the console screen.\n    - %d -\u003e Integer\n    - %s -\u003e String\n    - %f -\u003e Float\n    - print(\"Roll No is %d, Name is %s, Percentage are %f\"%(rollno,name,percentage))\n\n- `list:`\n    1. `append:` \n    2. `extend:` \n    3. `insert:`\n    4. `remove:`\n    5. `pop:`\n    6. `index:`\n    7. `count:`\n    8. `reverse:`\n    9. `sort:` \u0026 `sort:` `reverse=True`\n    10. `clear:`\n    11.  `copy:`\n\n    - `append:`\n        - Add the element at the end of the list.\n        - Tuple  also append in another list\n        - Set also append in another list\n        - It do partition in appended list by [] () \n        - Add full element\n    - `extend:`\n        - It merges new iteration into the current list.\n        - It do merges in existing list.\n        - It is Iterable Specific Method.\n        - It merge list does not make partition's\n        - extend list in another list\n        - extend tuple in another list\n        - extend element: add's one by one single charecter in the element added in list.\n    - `insert:`\n        - Add elemements at starting\n        - It is use to add element at specific index position inside a list.\n        - syntax: insert(index,element)\n    - `remove:`\n        - 1'st occurance remove.\n        - It will remove 1'st occurance of the specified element.\n    - `pop:`\n        - remove last element by default\n        - specific index element will be poped out.\n        - syntax: pop(index)\n    - `index:`\n        - It will return the index value of the specified element.\n    - `count:`\n        - It will return the no of occurance of the specified element. \n    - `reverse:`\n        - Reverse the order of your list.\n    - `sort:` \u0026 `sort:` `reverse=True`\n        - sort in asending order\n        - sort in descending order\n        - It is use to return in ascending order.\n        - It is use to return in descending order.\n    - `clear:`\n        - return empty list.\n        - delete all element in the list.\n    -  `copy:`\n        - copy's list in another destination.\n     \n- The extend() and append() functions in Python are methods used to modify lists, but they work differently in terms of how they add elements to the list.\n- `append() Method:`\n    - Purpose: Adds a single element to the end of the list.\n    - Behavior: The entire argument passed to append() is treated as a single element, even if it is a list or another iterable.\n    - Syntax: list.append(element)\n    - Parameters: Takes a single element as its argument.\n    - Return Value: Returns None (modifies the list in-place).\n    - Example 1: Adding a single element\n    - my_list = [1, 2, 3]\n    - my_list.append(4)  # Adds 4 as a single element\n    - print(my_list)  # Output: [1, 2, 3, 4]\n    - Example 2: Adding another list\n    - my_list = [1, 2, 3]\n    - my_list.append([4, 5])  # Adds [4, 5] as a single element\n    - print(my_list)  # Output: [1, 2, 3, [4, 5]]\n\n- `extend() Method:`\n    - Purpose: Extends the list by appending all elements from an iterable (e.g., another list, tuple, string, etc.).\n    - Behavior: It iterates over the argument and adds each element individually to the list.\n    - Syntax: list.extend(iterable)\n    - Parameters: Takes an iterable (e.g., list, tuple, string).\n    - Return Value: Returns None (modifies the list in-place).\n    - Example 1: Extending with another list\n    - my_list = [1, 2, 3]\n    - my_list.extend([4, 5])  # Adds 4 and 5 as separate elements\n    - print(my_list)  # Output: [1, 2, 3, 4, 5\n    - Example 2: Extending with a string\n    - my_list = [1, 2, 3]\n    - my_list.extend(\"45\")  # Adds '4' and '5' as separate elements\n    - print(my_list)  # Output: [1, 2, 3, '4', '5']\n\n\n`Key Differences`\n|Aspect         |append()\t|extend()|\n|---------------|-----------|--------|\n|Input\t        |Single element\t|Iterable (list, tuple, string, etc.)|\n|Behavior\t    |Adds the entire input as a single element\t|Iterates over the input and adds each element individually|\n|Use Case\t    |Adding a single item (object, number, etc.)\t|Adding multiple elements from an iterable|\n|Example\t    |list.append([4, 5]) → [[4, 5]]\t|list.extend([4, 5]) → [4, 5]|\n\n- When to Use\n    - Use append() when you want to add a single element to the list.\n    - Use extend() when you want to merge elements from another iterable into the list.\n\n\n- Visual Representation\n- For a list my_list = [1, 2, 3]:\n    - my_list.append([4, 5]) → [1, 2, 3, [4, 5]]\n    - my_list.extend([4, 5]) → [1, 2, 3, 4, 5]\n      \n- `Dictionary:`\n    1. `get:`\n    2. `items:`\n    3. `keys:`\n    4. `values:`\n    5. `copy:`\n    6. `update:`\n    7. `pop:`\n    8. `popitem:`\n    9. `clear:`\n        \n    - `get:`\n        - It will return corresponding value of the specified key\n        - syntax: get(key)\n        - one key at a time\n    - `items:`\n        - It will return key value pair in tuple format.\n    - `keys:`\n        - It will return list of keys in tuple format\n    - `values:`\n        - It will return list of values in tuple format\n    - `copy:`\n        - use to copy the data to the targeted destination \n    - `update:`\n        - It is use to update key value inside a dictionary\n        - If the key is already present then the value is replace\n        - If key is not present then key value apir is added to the dictoneary\n    - `pop:`\n        - It will remove the key value pair of specified kay  \n    - `popitem:`\n        - By default remove last kay value pair \n    - `clear:`\n        - Return empty dictoneary.\n     \n### `Inheritance: When The Object of child class aquires properties of object of parent class is called Inheritance. When One Child class aquires the properties of parent class is called Inheritance. V25.01.27`\n- `It is Object Oriented Concept.`\n- `Parent Class: Parent calss|Base Class|Super Class.`\n- `Child Class: Child Class|Derived Class|Sub Class.`\n- `It is Not mendatory to always say object word in the types of Inheritance defination.`\n### `Types of Inheritance:`\n- `Single Level Inheritance: When Object of One Child class aquries the properties of object of One Parent class.`\n- `Multilevel Inheritance: When One child class is the parent of another child class such inheritance is called as multilevel inheritance`\n- `Multiple Inheritance: When One child class inherited the properties of multiple parent class such inheritance is called as Multiple Inheritance.`\n- `Hybrid Inheritance: `\n\n- By default Constructor call in python when object is created.\n- Two Types Calling:\n- Child() -\u003e by Default -\u003e Implicit \n- obj.= Child() -\u003e By Own Hand -\u003e Explicit\n- Constructor creates Object(Memory) by default.\n- By default Object created Constructor Implictly.\n- mro() -\u003e Method Resolution Order. It is nothing but scequence of properties in Inheritance. -\u003e Proritywise.\n- Babli, Bunty, Pandi, Pandu, Object.\n- C-\u003eA\n- Call Imediate Parent Class. Still Implimented this Concept Beacouse, \n- It Accessing the elements of Parent calss B which is inherited from the Parent calss A. \n- Beacouse of Inheritance Still it can access the m1 method into the B class.\n- `Call Imediate Parent Class. Still Implimented this Concept Beacouse, It Accessing the elements of Parent calss B which is inherited from the Parent calss A. Beacouse of Inheritance Still it can access the m1 method into the B class.`\n\n- In object-oriented programming, multilevel inheritance and multiple inheritance are two different types of inheritance relationships in which child classes inherit features from one or more parent classes. Here's a detailed comparison:\n1. Multilevel Inheritance\n- Definition:\n- In multilevel inheritance, a class is derived from a class that is itself derived from another class. This forms a \"chain\" of inheritance where properties and methods are passed down through multiple levels.\n- Structure:\n    - Class A (Base Class)\n       ↑\n    - Class B (Derived from A)\n       ↑\n    - Class C (Derived from B)\n- Key Features:\n    - Inherits properties and methods from one parent class and passes them to the next level.\n    - Creates a hierarchical chain.\n    - Child classes can access properties and methods of all their ancestors.\n\n2. Multiple Inheritance\nDefinition:\nIn multiple inheritance, a class can inherit from more than one base class. This allows the derived class to access properties and methods from multiple parent classes.\n\n- Structure:\n    - Class A         Class B\n       ↑               ↑\n             Class C (Derived from A and B)\n\n- Key Features:\n    - Combines features from multiple parent classes into a single child class.\n    - Useful when a class needs to inherit different functionalities from various sources.\n    - Can lead to ambiguities (e.g., diamond problem) if multiple parent classes have methods with the same name.\n\n- Use Cases\n    - Multilevel Inheritance: When creating a hierarchy where each level specializes or adds to the behavior of its parent class.\n    - Multiple Inheritance: When combining functionalities from multiple, unrelated parent classes.\n\n- Summary\n    - Multilevel Inheritance: A step-by-step inheritance chain.\n    - Multiple Inheritance: Directly inherits from multiple classes.\n\n`Key Differences:`\n|Feature|\tMultilevel Inheritance|\tMultiple Inheritance|\n|-------|-------------------------|---------------------|\n|Definition|\tInheritance through multiple levels.|\tInheritance from multiple parent classes.|\n|Structure|\tForms a chain-like hierarchy.|\tCombines features from multiple sources.|\n|Number of Parents|\tA class inherits from a single parent at each level.|\tA class can inherit from two or more parents.|\n|Complexity|\tLess complex; linear structure.|\tMore complex; can lead to ambiguities.|\n|Example Classes|\tGrandparent → Parent → Child|\tFather, Mother → Child|\n|Common Issue|\tNo ambiguities.|\tPossible method resolution conflict (diamond problem).|\n\n\n## `datetime: V25.01.30` \n- `import datetime`\n- `datetime.datetime.now()` : Current Date Time.\n- `%a` = Sat\n- `%A` = Saturday\n- `%d` = 08\n- `%D` = 02/08/25\n- `%b` = Feb\n- `%B` = February\n- `%y` = 25\n- `%Y` = 2025\n- `%H` = Hours\n- `%M` = Minutes\n- `%S` = Secondes\n- `%f` = Microseconds\n- `%x` = Data\n- `%X` = Time\n- `%p` = PM|AM\n- `%I` = 12 Hour's Format\n- `%w` = 6\n- `%W` = 05\n- `%V` = scequence of weeks Monday | Sunday\n- `%c` = Sat Feb  8 22\\:22:57 2025\n\n## `Meta Charecters: (Regular Expressions)( search (Search in given data), findall (Find), sub (Replace), split (split according to Charecter or Space))` `Return Boolean Value`\n- Start : `^`\n- end : `$``\n- Remaining Charecters : `.*`\n- No of Charecters : `.`\n- Specific no of Charecters : `{3}`\n- Or : |\n- 0 or 1 Charecter : `.?`\n- 1 or More Charecters : `.+` \n\n## `Specical Charecters:` `Returns Boolean Value` \n- Start Charecter : `\"\\APratik\"`\n- End Charecter : `r\"Pratik\\b\"`\n- End Charecter : `r\"\\BPratik\"`\n- Digit Value Match : `\"\\d\"`\n- Non-Digit Value Match : `\"\\D\"`\n- Return Space Value : `\"%s\"`\n- Returen Non-Space Charecters : `\"%S\"`\n- Return Space and Special Charecters : `\"%W\"`\n- Return Charecters : `\"%w\"`\n- Return end with Charecters : `\"%z\"`\n\n\n## `Polymorphism V25.01.31`\n\n### **Polymorphism in Python – From Beginner to Advanced**  \n\nPolymorphism is a key concept in Object-Oriented Programming (OOP) that allows objects of different classes to be treated as objects of a common superclass. This enables flexibility and reusability in code.  \n\n---\n\n## **🔹 1. What is Polymorphism?**  \n**Polymorphism** means \"many forms\" and allows the same function or operator to have different meanings depending on the context.\n\n💡 **Real-life Analogy:**  \nA single word can have different meanings in different situations.  \nFor example, the word **\"run\"** can mean:  \n- **A person runs** 🏃 (physical activity)  \n- **A program runs** 💻 (execution of software)  \n- **A car runs** 🚗 (a vehicle in motion)  \n\nIn Python, polymorphism allows us to use the same method name, function, or operator in multiple ways.\n\n---\n\n## **🔹 2. Types of Polymorphism in Python**  \nPython supports four types of polymorphism:  \n\n1. **Method Overriding (Runtime Polymorphism)**\n2. **Method Overloading (Compile-time Polymorphism)**\n3. **Operator Overloading**\n4. **Duck Typing**  \n\n---\n\n## **🔸 3. Method Overriding (Runtime Polymorphism)**\n🔹 **Definition:** Method overriding allows a subclass to provide a specific implementation of a method that is already defined in its parent class.\n\n🔹 **Key Points:**  \n✔ Parent and child class have the same method name.  \n✔ The child class method **overrides** the parent class method.  \n\n### **Example of Method Overriding**\n```python\nclass Animal:\n    def make_sound(self):\n        print(\"Some generic sound\")\n\nclass Dog(Animal):\n    def make_sound(self):  # Overriding the parent method\n        print(\"Bark!\")\n\nclass Cat(Animal):\n    def make_sound(self):  # Overriding the parent method\n        print(\"Meow!\")\n\n# Creating objects\na = Animal()\nd = Dog()\nc = Cat()\n\n# Calling the method\na.make_sound()  # Output: Some generic sound\nd.make_sound()  # Output: Bark!\nc.make_sound()  # Output: Meow!\n```\nHere, the `make_sound()` method behaves differently depending on the object calling it.\n\n---\n\n## **🔸 4. Method Overloading (Compile-time Polymorphism)**\n🔹 **Definition:**  \nMethod overloading allows multiple methods with the **same name** but **different arguments**.  \n\n🔹 **Important Note in Python:**  \nUnlike Java or C++, **Python does not support method overloading directly**. However, we can achieve it using default arguments or variable-length arguments (`*args` and `**kwargs`).\n\n### **Example of Method Overloading**\n```python\nclass MathOperations:\n    def add(self, a=None, b=None, c=None):  \n        if a is not None and b is not None and c is not None:\n            return a + b + c\n        elif a is not None and b is not None:\n            return a + b\n        else:\n            return a\n\n# Creating object\nmath_op = MathOperations()\n\n# Calling the method with different parameters\nprint(math_op.add(5, 10))       # Output: 15\nprint(math_op.add(5, 10, 15))   # Output: 30\nprint(math_op.add(5))           # Output: 5\n```\n🔹 Here, the same method `add()` behaves differently based on the number of arguments passed.\n\n---\n\n## **🔸 5. Operator Overloading**\n🔹 **Definition:**  \nPython allows us to redefine built-in operators like `+`, `-`, `*`, `==`, etc., for custom objects.  \n\n### **Example of Operator Overloading**\n```python\nclass Point:\n    def __init__(self, x, y):\n        self.x = x\n        self.y = y\n\n    def __add__(self, other):  # Overloading the `+` operator\n        return Point(self.x + other.x, self.y + other.y)\n\n    def __str__(self):  # For better printing of the object\n        return f\"({self.x}, {self.y})\"\n\np1 = Point(2, 3)\np2 = Point(4, 5)\np3 = p1 + p2  # Calls the __add__ method\n\nprint(p3)  # Output: (6, 8)\n```\n🔹 The `+` operator is redefined to **add two objects of `Point` class**.\n\n---\n\n## **🔸 6. Duck Typing (Dynamic Polymorphism)**\n🔹 **Definition:**  \nPython follows the **\"If it looks like a duck and quacks like a duck, it must be a duck\"** principle.  \n- It means we don’t check the type of an object, but its **behavior**.\n\n### **Example of Duck Typing**\n```python\nclass Bird:\n    def fly(self):\n        print(\"Bird is flying\")\n\nclass Airplane:\n    def fly(self):\n        print(\"Airplane is flying\")\n\nclass Fish:\n    def swim(self):\n        print(\"Fish is swimming\")\n\n# Common function that uses Duck Typing\ndef make_it_fly(entity):\n    entity.fly()\n\n# Creating objects\nbird = Bird()\nairplane = Airplane()\nfish = Fish()\n\nmake_it_fly(bird)      # Output: Bird is flying\nmake_it_fly(airplane)  # Output: Airplane is flying\n# make_it_fly(fish)    # This will cause an AttributeError\n```\n🔹 Here, `make_it_fly()` calls the `fly()` method without caring about the object's class.\n\n---\n\n## **🔹 7. Advanced Concepts in Polymorphism**\n### **A. Using Polymorphism with Inheritance**\n```python\nclass Shape:\n    def area(self):\n        pass  # To be implemented by subclasses\n\nclass Circle(Shape):\n    def __init__(self, radius):\n        self.radius = radius\n\n    def area(self):\n        return 3.14 * self.radius * self.radius\n\nclass Square(Shape):\n    def __init__(self, side):\n        self.side = side\n\n    def area(self):\n        return self.side * self.side\n\nshapes = [Circle(5), Square(4)]\nfor shape in shapes:\n    print(shape.area())  # Calls appropriate method\n```\n🔹 The `area()` method behaves differently for `Circle` and `Square`.\n\n---\n\n### **B. Polymorphism with Abstract Classes**\nWe can enforce polymorphism using **abstract classes** with the `abc` module.\n\n```python\nfrom abc import ABC, abstractmethod\n\nclass Animal(ABC):\n    @abstractmethod # Decoretors\n    def sound(self):\n        pass\n\nclass Dog(Animal):\n    def sound(self):\n        return \"Bark!\"\n\nclass Cat(Animal):\n    def sound(self):\n        return \"Meow!\"\n\n# Creating objects\nanimals = [Dog(), Cat()]\nfor animal in animals:\n    print(animal.sound())  # Calls the appropriate implementation\n```\n🔹 Here, the `sound()` method is **forced** to be implemented by all subclasses.\n\n---\n\n## **🔹 8. Key Takeaways**\n✅ **Polymorphism** allows methods to be redefined in derived classes.  \n✅ **Method Overriding** is runtime polymorphism where a subclass redefines a method of its superclass.  \n✅ **Method Overloading** is mimicked in Python using default arguments.  \n✅ **Operator Overloading** allows defining custom behavior for built-in operators.  \n✅ **Duck Typing** enables dynamic polymorphism without checking an object's type.  \n✅ **Abstract Classes** enforce polymorphism by requiring subclasses to implement methods.\n\n---\n\n## `File Handling V25.01.31`\n\n### **Complete Guide to File Handling in Python (Beginner to Advanced)**  \n\nPython provides built-in functions to **create, read, write, and manipulate files**. Understanding file handling is crucial for working with data, logs, configurations, and more.\n\n---\n\n## **1️⃣ Basics of File Handling in Python**\nPython uses the built-in `open()` function to interact with files.\n\n### **Syntax:**\n```python\nfile = open(\"filename\", \"mode\")\n```\n- `\"filename\"` → Name of the file with extension (e.g., `\"data.txt\"`).\n- `\"mode\"` → Specifies how the file will be used.\n\n---\n\n## **2️⃣ File Opening Modes**\n| Mode | Description |\n|------|------------|\n| `r`  | Read (default) – Opens a file for reading; error if file does not exist |\n| `w`  | Write – Creates a new file or overwrites an existing file |\n| `a`  | Append – Opens a file for appending; creates a new file if it doesn’t exist |\n| `x`  | Exclusive Creation – Creates a new file; error if file exists |\n| `b`  | Binary mode – Opens file in binary format (e.g., images, PDFs) |\n| `t`  | Text mode (default) – Opens file in text mode |\n\n🔹 **Modes can be combined**:  \n- `\"rb\"` → Read in binary  \n- `\"wt\"` → Write in text  \n- `\"a+\"` → Append and read  \n- `\"wb+\"` → Write and read in binary  \n\n---\n\n## **3️⃣ Reading Files in Python**\n#### **Method 1: Using `read()`**\nReads the entire file as a string.\n```python\nfile = open(\"example.txt\", \"r\")\ncontent = file.read()\nprint(content)\nfile.close()\n```\n\n#### **Method 2: Using `readline()`**\nReads one line at a time.\n```python\nfile = open(\"example.txt\", \"r\")\nline = file.readline()\nprint(line)\nfile.close()\n```\n\n#### **Method 3: Using `readlines()`**\nReads all lines and returns them as a list.\n```python\nfile = open(\"example.txt\", \"r\")\nlines = file.readlines()\nprint(lines)\nfile.close()\n```\n\n---\n\n## **4️⃣ Writing Files in Python**\n#### **Method 1: Using `write()`**\nWrites text to a file (overwrites if it exists).\n```python\nfile = open(\"example.txt\", \"w\")\nfile.write(\"Hello, World!\\nThis is a new file.\")\nfile.close()\n```\n\n#### **Method 2: Using `writelines()`**\nWrites multiple lines to a file.\n```python\nlines = [\"First Line\\n\", \"Second Line\\n\", \"Third Line\\n\"]\nfile = open(\"example.txt\", \"w\")\nfile.writelines(lines)\nfile.close()\n```\n\n---\n\n## **5️⃣ Appending to a File**\nTo **add new content** without deleting existing content, use `\"a\"` mode.\n```python\nfile = open(\"example.txt\", \"a\")\nfile.write(\"\\nThis is an appended line.\")\nfile.close()\n```\n\n---\n\n## **6️⃣ Best Practice: Using `with` Statement (Automatic Closing)**\nThe `with` statement ensures the file closes automatically.\n```python\nwith open(\"example.txt\", \"r\") as file:\n    content = file.read()\n    print(content)\n# No need to manually call file.close()\n```\n\n---\n\n## **7️⃣ Checking If a File Exists**\nUsing the `os` module:\n```python\nimport os\n\nif os.path.exists(\"example.txt\"):\n    print(\"File exists!\")\nelse:\n    print(\"File does not exist!\")\n```\n\n---\n\n## **8️⃣ Deleting a File**\nUsing `os.remove()`:\n```python\nimport os\nos.remove(\"example.txt\")\n```\n\nTo delete a folder:\n```python\nos.rmdir(\"folder_name\")\n```\n\n---\n\n## **9️⃣ Working with Binary Files (Images, PDFs)**\n### **Reading a Binary File**\n```python\nwith open(\"image.jpg\", \"rb\") as file:\n    data = file.read()\n    print(data[:50])  # Print first 50 bytes\n```\n\n### **Writing to a Binary File**\n```python\nwith open(\"copy.jpg\", \"wb\") as file:\n    file.write(data)\n```\n\n---\n\n## **🔟 Advanced File Handling Techniques**\n### **1. Moving \u0026 Renaming Files**\n```python\nimport os\nos.rename(\"old_name.txt\", \"new_name.txt\")\n```\n\n### **2. Copying Files**\nUsing `shutil` module:\n```python\nimport shutil\nshutil.copy(\"source.txt\", \"destination.txt\")\n```\n\n### **3. Getting File Metadata**\n```python\nimport os\n\nfile_info = os.stat(\"example.txt\")\nprint(f\"Size: {file_info.st_size} bytes\")\nprint(f\"Last modified: {file_info.st_mtime}\")\n```\n\n### **4. Reading Large Files Efficiently**\nIf a file is too large, read it line by line:\n```python\nwith open(\"large_file.txt\", \"r\") as file:\n    for line in file:\n        print(line, end=\"\")\n```\n\n---\n\n## **🔹 Summary**\n| Concept | Function |\n|---------|----------|\n| Open File | `open(\"filename\", \"mode\")` |\n| Read File | `read()`, `readline()`, `readlines()` |\n| Write to File | `write()`, `writelines()` |\n| Append to File | `append(\"data\")` |\n| Close File | `file.close()` |\n| Best Practice | `with open(...) as file:` |\n| Check Existence | `os.path.exists(\"file\")` |\n| Delete File | `os.remove(\"file\")` |\n| Work with Binary | `\"rb\"`, `\"wb\"` modes |\n| Copy File | `shutil.copy()` |\n| Move/Rename File | `os.rename()` |\n\n---\n\n## `File Handling`\n- `r: Read Mode:`\n    - It can read file.\n    - File should already exist.\n    - It cannot write the data into the file.\n- `w: Write Mode:`\n    - File Create.\n    - Overwride the existing File.\n    - It can write the data into the file.\n- `a: Append Mode:`\n    - It adds data end of the line.\n    - File should be already in existance.\n    - It allows write function.\n    - It does not create a new file. \n- `w+: Write and Read Mode:`\n    - It can Create a new file.\n    - It allows reading over action.\n- `a+: append and Read Mode:`\n    - It allows read write and append function.\n    - Symbol is a+.\n    - It can create a file.\n    - But it does not Overwrite. \n\n## `numpy: V25.02.03`\n- Connect Wifi\n- Open jupyter\n- Pip install numpy : use to Install this Package.\n- numpy - Package (Packase) - Set of Functions - Numerical Python - Array\n- numpy stands for Numerical Python.\n- It is an Array orinted Library.\n- Array function is use to declared an array.\n- Array is faster than a list as no new memory is created for Element. Efficient Memory management and Time management.\n- It can be declared in list format.\n- import numpy\n- import numpy as np\n- as : Aliance : Another name refer to this entity (Library)\n- print(type(arr)) : class-numpy.ndarray\n- `Array:`\n    - Collection of elements of different data types.\n    - List and array define same but memory allocation is different.\n    - List with common memory allocation.\n- 0D : Zero Dimentional | consist only 1 Element\n    - a = np.array([22]) \n- 1D : 1 Dimentional | Uni Dimentional | Consist only Rows\n    - a = np.array([1,2,3,4,5])\n- 2D : 2 Dimentional | Collection of Row's and Column's\n    - a = np.array([[1,2],[3,4]],[[5,6],[7,8]])\n- 3D : 3 Dimentional | x y z Dimentions\n    - a = np.array([[[1,2],[3,4]],[[5,6],[7,8]],[[9,10],[11,12]]])\n- length : Total No of Elements eg.,5 \n- Index : Strat from 0 indexth Element eg.,5-1=4\n- ndim : Return Dimention of Array\n- `Index:`\n    - Index Position returns array Value Element.\n    - Value can be featched by specifing position.\n    - It should be specifing in square brackets.\n    - print(a[0])\n    - Negative Indexing allowed.\n    - Negative indexing start search from extreme right. \n    - print(a[-1])\n    - In more than 1D array the indexing is in this format:\n        - 1'st priority given to Value index.\n        - 2'nd priority given to Element index.\n        - 3'rd priority given to Set index | Dimention index.\n- `Slicing:`\n    - It is used to select set of array by specifing start and end point by separating by : (Colan).\n    - If starting point is not mention it is consider as a endpoint. not mention means it consider as a last index position.\n    - Steps : Difference\n- `Sort:`\n    - It assembles the element of array in ascending order  \n- `searchsorted:`\n    - Show's where you can add that index position.\n    - a[5] = 43 : It will replace the value in given array.\n    - Search sorted need sort array in ascending order.\n    - It is a function which helps to load a new value without disturbing the order. \n\n## `Polymorphism \u0026 Exception Handling:`\n\n### `Polymorphis:` \n- Polimorphism is Object Oriented Concept.    \n- `poly`: many `morphism`: forms | types\n- Compiletime and Runtime these are not Object oriented concepts. beacouse this concepts present in C language. But Clanguage is not Object oriented language.\n- Types of Polymorphism:\n    - Overloading (Compiletime Polimorphism)\n    - Overriding (Runtime Polimorphism)\n- Method Overloading:\n    - When a single class having many methods with same name but with different parameters is called method Overloading.\n    - Python does not support method overloading directly. However, we can achieve it using default arguments or variable-length arguments` (`*args` and `**kwargs`).\n    - one class | one method (self, defaultParameter1=None, defaultParameter2=None ) | if (defaultParameter1 is not None and defaultParameter2 is not None) return; elif(defaultParameter is not None) return; else return; by using this conditions we can do the method Overloading.  \n- Method Overridding:\n    - When the Parent and the Child class having same Name and same Parameters is called as Method Overriding.\n    - Inheritance is required to achive the Method Overridding.\n    - Super() method use to access and execute imediate parent class method. It also requires Inheritance to access imediate parent class method.\n    - Here we need to create separate object of each class to execute each class method or else we have to use super() method.\n    - Else Method Overridding can only execute last class last method.    \n\n### `Exception Handling:`\n- Error : Syntax error : throw by Compiler : On Compiletime \n- Exception : Logical Exception : throw by Pvm(Python Virtual Machine) (Byte Code Verification) (Check Binary Code Standards) : on Runtime \n- We do exception handling on subspecious code beacouse we have to prevent from code termination.  \n- Error occuring at Runtime is called `Exception.`\n- Try and Except black is used to handle Exception.\n- The code is written within the try block.\n- The try block throws exception if occurs.\n- Except block handles the exception and prevent from termination of the code.\n- This block activates only when exception is throw by try block.\n- Every exception is Predefined class in python.\n- Not Necessary to give class name while handling except block.\n- unboxin the list : Storing indivisual element into the indivisual variable.\n\n- `eg., ZeroDivisionError`\n- `Except block executed : When exception throw by try block.`\n- `Else block executed : When Exception not throw by try block.`\n- `Finnaly block executed : Whether Exception throw or not throw by try block.`\n\n- Exception Handling blocks:\n    - try: Throw exception.\n    - except: Handle the exception thrown by try block.\n    - else: Executes when exception not thrown by try block.\n    - finally: Executes whether exception throw or not throw br try block.\n\n- `Exception Handling:`\n    1. `ZeroDivisionError:`  `eg,.96/0`\n    2. `IndexError:`  `List out of bound eg,.a[7], range out of list eg,.(len(a)+2)`\n    3. `NameError:`  `Function Misspelled eg,.(data2()), Not Defined | Undefined Variable eg,.(print(a2))` \n    4. `keyError:`  `Dictionary eg,.(data[7])`\n    5. `TypeError:` `String and Float Concatination eg,.(\"Pratik\"+7), Iterate String on Integer eg,.(for Pratik in 1234567) pass`\n    6. `ValueError:` `Type Conversion eg,.(name = float(\"Hello\")), Unboxing the List eg,.(p,q,r,s,t = data)` \n\n- Type of Exceptions:\n    - ZeroDivisionError : Division by 0\n    - IndexError : List index out of bound and range(for loop) is out of bound eg.,(a\\[12]-\u003eAccepts index position)\n    - KeyError : Dictionary | It occurs when specify non existing key value pair.\n    - NameError : Undefined | Not-defined | When your function name misspelled. or variable is not define and you are using\n    - ValueError : Type conversion and Unboxing the list\n    - TypeError:\n        - Beacouse of Data Types Miss Match\n        - Concatination of string and integer\n        - Iterate string on integer\n        - Variable and Object is not collable. eg.,data = \"Hello\"; print(data());  \n\n## `Matplotlib V25.02.11`\n- `pip install matplotlib.`\n- `import matplotlib.pyplot as pt`\n- matplotlib is a Python Library | Package.\n- pyplot is subplot of matplot library.\n- `pip install numpy.`\n- Numpu is numerical python library.\n- Graph x and y axis. Cordinates.\n- x - Horizontal\n- y - Vertical\n- Graph -\u003e plot (x-cordinate, y-cordinate)\n- Matplotlib Library:\n    - It is Graph and Chart oriented Library.\n    - It's sublibrary is pyplot.\n    - It can be use through alises.\n    - plot() function is use plot the Graph.\n    - syntax: pt.plot(x-cordinates, y-cordinates)\n    - It can display grapg with some kind of Notification.\n    - show() function is use to display the Graph.\n    - syntax: pt.show()\n    - X and Y cordinate ctrate using nupy library.\n    - syntax: x = np.array(\\[10,20])\n- `Markers:`\n    - Markers heilight the Intersecting Points.\n    - There are various types of Markers.\n    1. `Circle:` `'o'`\n    2. `Star:` `'*'`     \n    3. `Point:` `'.'`     \n    4. `Pixcel:` `','`\n    5. `x-marker:` `'x'`\n    6. `Filled-X:` `'X'`\n    7. `Plus Sign:` `'+'`\n    8. `Filled Plus:` `'P'`\n    9. `Square:` `'s'`\n    10. `Diamond:` `'D'`\n    11. `Thin Diamond:` `'d'`\n    12. `Pentagoan:` `'p'` 5 Sides     \n    13. `Hexagoan:` `'H'` 6 Sides     \n    14. `Small hexagoan:` `'h'`\n    15. `Down Triangle:` `'V'`\n    16. `Up Triangle:` `'^'`\n    17. `Right Triangle:` `'\u003e'`     \n    18. `Left Triangle:` `'\u003c'`     \n    19. `Tri Up:` `'1'`     \n    20. `Tri Down:` `'2'`     \n    21. `Tri Left:` `'3'`     \n    22. `Tri Right:` `'4'`     \n    23. `V line:` `'|'` Bar     \n    24. `H line:` `'-'` Underscore\n- `Default x- axis:`\n    - When only 1 point of a single axis are given then Defult value of x-axis are taken.\n    - Default y-axis is not possible.\n- `Colors: syntax: eg., c='k'`\n    - Total 140-150 colors available.\n    1. `r: red`  \n    2. `g: green`  \n    3. `b: blue`  \n    4. `k: black`  \n    5. `y: yellow`\n    6. `c: cyan`\n    7. `m: maginta`  \n- `Line Style (ls): | Line Format  syntax: eg., ls='*--'`  \n    1. Dashed Line : '*--'\n    2. Double Dashed Line : '*--'\n    3. Dotted Line : '*:'\n    4. Dashed-Dotted Line : '*-.'\n- `Marker Size (ms): syntax: eg., ms'7.8'`  \n- `Marker color (mec): syntax: eg., mec='k'`\n- `Marker Face Color (mfc): syntax: eg., mfc='r'`\n- `linewidth: syntax: eg., linewidth='5.3'`\n- `Grid: It Provide's Symettrical graph as a Background. syntax: eg., pt.grid()`\n- `Axis: syntax: eg., axis='y'`\n- `Title: syntax: eg., pt.title(\"Python Graph\")`\n- `x-Label: syntax: eg., pt.xlabel(\"x-axis\")`\n- `y-Label: syntax: eg., pt.ylabel(\"y-axis\")`\n- `Scatter: syntax: eg., pt.scatter(x,y,marker='*')`\n\n## `Matplotlib Library V25.02.13`\n- `subplot:`\n    - syntax: pt.subplot(row,cloumn,position)\n    - 1'st plot the graph and the all done! then show() on screen\n    - pt.title(\"Graph-1\")\n    - pt.tight_layout()\n    - pt.suptitle(\"Sub-Plot\")\n- `Bar:`\n    - Separate bar's for each points.\n    - By default bar width and height is 0.8.\n    - bar: width\n    - barh: height\n    - color=\"red\"\n    - Histogram: Bars are joint toeach other. mosty use standerd Deviation\n- `Pie:`\n    - Circular graphs\n    - Single array is use to display pie graph. \n    - Anticlockwise\n    - At Center = 0 degree\n    - position = Specific value / Total Summation of all values\n    - blue, orange, green, red Default Colors.\n    - labels=users (users is array)\n    - explode=ex (ex is array)\n    - shadow=True\n    - startangle=90\n    - colors=colors (colors is array)\n\n## `Pandas Library:`\n- `pandas:`\n    - pip install pandas\n    - import pandas as pd\n    - mostly support csv files\n    - DataFrames (Return 1st and last 5 record's)\n    - pd.read_csv(\"C:/Users/majag/Desktop/data.csv\")\n    - view.to_string() (reeturn all data)\n    - view.info() (Return file information)\n    - plot() (Return line gragh)\n\n## `Math Library`\n- `Math:`\n    - math.pi()\n    - math.e()\n    - math.sqrt()\n    - math.isqrt() (Return Base Integer Value)\n    - math.fabs() (Return Absolute Value, Returning Positive value)\n    - math.ceil(34.9) (35)\n    - math.ceil(-34.9) (-35)\n    - math.floor(34.9) (34)\n    - math.floor(-34.9) (-34)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n`------------------------------------------------------------------------------------------------------------------`\n# `Java:`\n\nIn Java, **multiple inheritance is partially supported**. Here's a detailed explanation:\n\n---\n\n### **1. Multiple Inheritance with Classes**\n- Java does **not support multiple inheritance** with classes.\n- This restriction exists to avoid **ambiguities** caused by the **diamond problem**, where two parent classes may have methods with the same name, leading to conflicts.\n- If you try to inherit from multiple classes, the compiler will throw an error.\n\n#### **Example of Unsupported Multiple Inheritance**:\n```java\nclass ClassA {\n    void show() {\n        System.out.println(\"ClassA method\");\n    }\n}\n\nclass ClassB {\n    void show() {\n        System.out.println(\"ClassB method\");\n    }\n}\n\n// Compilation error: Cannot inherit from multiple classes\nclass ClassC extends ClassA, ClassB {\n    public static void main(String[] args) {\n        ClassC obj = new ClassC();\n        obj.show();\n    }\n}\n```\n\n**Error**:  \n`ClassC cannot inherit from both ClassA and ClassB.`\n\n---\n\n### **2. Multiple Inheritance with Interfaces**\n- Java supports multiple inheritance through **interfaces**.\n- A class can implement multiple interfaces, and there is no ambiguity because interfaces only declare methods (they do not provide implementations, except in the case of default methods introduced in Java 8).\n\n#### **Example of Supported Multiple Inheritance with Interfaces**:\n```java\ninterface InterfaceA {\n    void showA();\n}\n\ninterface InterfaceB {\n    void showB();\n}\n\nclass ClassC implements InterfaceA, InterfaceB {\n    public void showA() {\n        System.out.println(\"InterfaceA method\");\n    }\n    \n    public void showB() {\n        System.out.println(\"InterfaceB method\");\n    }\n    \n    public static void main(String[] args) {\n        ClassC obj = new ClassC();\n        obj.showA();\n        obj.showB();\n    }\n}\n```\n\n**Output**:\n```\nInterfaceA method\nInterfaceB method\n```\n\n---\n\n### **3. Handling Ambiguity with Default Methods (Java 8)**\n- If two interfaces have **default methods** with the same name, the implementing class must **override** the method to resolve the ambiguity.\n\n#### **Example of Resolving Ambiguity**:\n```java\ninterface InterfaceA {\n    default void show() {\n        System.out.println(\"InterfaceA default method\");\n    }\n}\n\ninterface InterfaceB {\n    default void show() {\n        System.out.println(\"InterfaceB default method\");\n    }\n}\n\nclass ClassC implements InterfaceA, InterfaceB {\n    // Resolving ambiguity\n    @Override\n    public void show() {\n        System.out.println(\"Overridden method in ClassC\");\n    }\n    \n    public static void main(String[] args) {\n        ClassC obj = new ClassC();\n        obj.show();\n    }\n}\n```\n\n**Output**:\n```\nOverridden method in ClassC\n```\n\n---\n\n### **Why Java Does Not Support Multiple Inheritance with Classes**\n1. **Diamond Problem**:\n   - When two parent classes have methods with the same name, the compiler cannot determine which method to inherit.\n\n2. **Code Maintainability**:\n   - It avoids the complexity and confusion of handling multiple class hierarchies.\n\n3. **Interfaces as a Solution**:\n   - Interfaces allow multiple inheritance of behavior (method declarations) without leading to ambiguity since the class implementing the interfaces provides the method implementation.\n\n---\n\n### **Summary**\n- **Java does not allow multiple inheritance with classes** to avoid ambiguity (diamond problem).\n- **Java allows multiple inheritance through interfaces**, providing a clean and conflict-free solution.\n\n`------------------------------------------------------------------------------------------------------------------`\n`------------------------------------------------------------------------------------------------------------------`\n\nHere are 20 Python OOP (Object-Oriented Programming) practice questions covering **Multiple Inheritance, Multilevel Inheritance, Super Keyword, and Other OOP Concepts**:  \n\nThese questions will help you **practice Multiple Inheritance, Multilevel Inheritance, Super Keyword, Method Overriding, Constructor/Destructor, Polymorphism, Abstraction, and Encapsulation in Python.** \n\n### **Multiple Inheritance Questions:**  \n**Q1.** Using Multiple Inheritance, create separate classes for Armstrong, Palindrome, Factorial, and Fibonacci Series, and display their results.  \n\n**Q2.** Using Multiple Inheritance, draw:  \n  - Class 1: Pyramid  \n  - Class 2: Reverse Pyramid  \n  - Class 3: Diamond  \n  - Class 4: Use the **super()** method  \n\n**Q3.** Create a program using Multiple Inheritance where:  \n  - Class **Person** has attributes: name, age  \n  - Class **Job** has attributes: job_title, salary  \n  - Class **Employee** inherits both and displays details  \n\n**Q4.** Implement a **Bank System** using Multiple Inheritance with:  \n  - Class **Customer**: Contains name and account number  \n  - Class **Transaction**: Handles deposit and withdrawal  \n  - Class **BankAccount**: Inherits from both and maintains balance  \n\n**Q5.** Design a **Student Grading System** using Multiple Inheritance with:  \n  - Class **Student**: Name, roll number  \n  - Class **Marks**: Subject marks  \n  - Class **Result**: Inherits from both and calculates total marks and percentage  \n\n---\n\n### **Multilevel Inheritance Questions:**  \n**Q6.** Using Multilevel Inheritance, create a program that displays **String Methods** in one class and **List Methods** in another. Use **super()** to call methods from parent classes.  \n\n**Q7.** Implement a **Vehicle Hierarchy** using Multilevel Inheritance:  \n  - Class **Vehicle**: General attributes (e.g., brand, model)  \n  - Class **Car**: Specific car details (e.g., number of doors)  \n  - Class **SportsCar**: High-speed car features  \n\n**Q8.** Create a **Library Management System** using Multilevel Inheritance with:  \n  - Class **Library**: Stores book details  \n  - Class **Librarian**: Manages book lending  \n  - Class **User**: Borrows books  \n\n**Q9.** Design an **Online Shopping System** using Multilevel Inheritance:  \n  - Class **Product**: Stores product details  \n  - Class **Customer**: Stores customer information  \n  - Class **Order**: Manages order processing  \n\n**Q10.** Develop an **E-commerce Application** with:  \n  - Class **User**: Contains user details  \n  - Class **Buyer**: Inherits from User and adds cart functionality  \n  - Class **Order**: Processes orders  \n\n---\n\n### **Super Keyword \u0026 Method Overriding Questions:**  \n**Q11.** Create a program to show how **super()** is used in **Multiple Inheritance** to avoid ambiguity.  \n\n**Q12.** Implement **Method Overriding** in Python using a base class `Animal` and derived classes `Dog`, `Cat` that override the `make_sound()` method.  \n\n**Q13.** Design a **University Management System** where:  \n  - Class **Person**: Stores name and age  \n  - Class **Teacher** and **Student** inherit from Person  \n  - Use **super()** to initialize attributes  \n\n**Q14.** Implement a **Banking System** with:  \n  - Class **Bank**: Contains bank name and branch  \n  - Class **Account**: Inherits Bank and stores account details  \n  - Class **SavingsAccount**: Adds interest calculation  \n\n**Q15.** Create a **Shape Drawing System** where:  \n  - Class **Shape**: Defines a general draw() method  \n  - Class **Circle**, **Rectangle**, **Triangle** override draw()  \n\n---\n\n### **Constructor, Destructor, Polymorphism, and Abstraction Questions:**  \n**Q16.** Implement **Constructor Overloading** using default arguments in Python.  \n\n**Q17.** Demonstrate **Destructor (`__del__` method)** in Python using a class `Demo` to track object deletion.  \n\n**Q18.** Implement **Polymorphism** where different classes implement a common method `calculate_area()`.  \n\n**Q19.** Use **Abstract Classes** and **Methods** (`ABC` module) to create a program where:  \n  - Class **Shape** is abstract  \n  - Derived classes **Circle**, **Square**, **Triangle** implement `calculate_area()`  \n\n**Q20.** Implement **Encapsulation** where:  \n  - A class has private variables  \n  - Uses getter and setter methods to modify and access private variables  \n\n---\n\n\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpratikrameshmajage%2Fpython","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpratikrameshmajage%2Fpython","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpratikrameshmajage%2Fpython/lists"}