Skip to content

bhawani0x/python-codes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 

Repository files navigation

Python Basics

Python is an interpreted programming language. Object-Oriented Programming (OOP) is a paradigm for organizing code for increased reusability and modularity.

Classes and Objects

A class is a blueprint for creating objects with shared properties and methods. An object is an instance of a class.

Inheritance

Inheritance allows a class to inherit properties and methods from another class. Types of inheritance include single-level, multilevel, hierarchical, multiple, and hybrid inheritance.

Method Overriding

Method overriding occurs when a child class defines a method with the same name as a method in the parent class.

Super() Function

The super() function is used within a child class to call methods from the parent class.

Encapsulation

Encapsulation involves hiding the internal details of an object and restricting direct access to its components.

Polymorphism

Polymorphism allows methods to behave differently based on the objects they operate on. Method overloading and method overriding are examples of polymorphism.

Decorators

Decorators modify or extend the behavior of functions without changing their code. They are denoted by the @decorator_name syntax.

Functional Programming Concepts

Lambda functions are anonymous functions used for small, single-expression tasks. The map() function applies a function to each element of an iterable. The filter() function filters elements from an iterable based on a specified condition.

Exception Handling

Exception handling using try, except, else, and finally blocks allows for graceful error handling in Python.

Modules and Packages

Modules are files containing Python code that can be imported and used in other Python files. Packages are collections of related modules.

Comprehensions

Comprehensions provide a concise way to create sequences like lists, dictionaries, and sets.

Built-in Functions

Various built-in functions like enumerate(), zip(), sorted(), type(), etc., perform common tasks in Python.

Control Statements

Control statements like if, else, elif, for, while, etc., control the flow of program execution.

Type Casting

Type casting converts one data type to another, e.g., converting an integer to a string.

Sorting Algorithms

Sorting algorithms like Bubble Sort, Selection Sort, Insertion Sort, Merge Sort, and Quick Sort organize elements in a specified order.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages