Posts

Python OOP (Object-Oriented Programming) — With Real Examples

Image
 Python OOP (Object-Oriented Programming ) — With Real Examples Object-Orientation Programming (OOP) is one of the most important concepts in Python especially if you want to build scalable and real-world applications. What is OOP? OOP is a programming approach where you organize code using objects and classes instead of just functions. Think of it like: Class = Blueprint Object = Real-world item built from that blueprint  Class (Definition) A class is a blueprint or template used to create objects. It defines properties (variables) and behaviors (methods) that the objects will have. Suppose Student as a class which has properties as his name and marks. Example: class Student:     name ="Rahul"     marks = 90 Object (Definition) A object is an instance of a class. It represents a real-world entity and can access the properties and method defined in the class. Example: s1= Student() print(s1.name) 4 Pillars of OOP in Python Encapsulation Abstraction Inherita...

String Handling in Python: Complete Beginner Guide

 String Handling in Python: Complete Beginner Guide String are one of the most commonly used data types in python. Whether you're working with user input, files, or APIs, understanding string handling is essential.  What is a String in Python? A string is a sequence of characters enclosed in quotes. Strings are immutable i.e., cannot be changed after creation.  String can be depicted inside single quotes (' '), double quotes(" ") and Triple quotes (''' '''). Triple quotes are used for multiline string i.e. writing string in multiple lines, we can write string in multi-line with single and double string too but for that either you have to do following: text="happy" next="birthday" OR text="happy\n birthday" both of the above code will give you same output as follows: happy  birthday But with triple quote we can simply write as : #''' This is python blogging page, where you learn more and grow your pr...

Python Dictionaries Explained for Beginners | Key-Value Pairs in Python

Python Dictionaries- Store Data in  Key-Value Pairs Introduction This is one of the most important data structures in Python and used heavily in real project, APIs and interviews. Till now, we learned how to store multiple values using lists and tuples. But, what if you want to store data like this? Name - Sonu Age - 25 Course - Python  Instead of remembering index positions, Python gives us a smarter way: Dictionaries A dictionary stores data in key-value pairs. Think you it like a real dictionary: word = key meaning = value Let's understand it step by step. What is a Dictionary? A dictionary is a collection of key-value pairs stored inside curly braces {} where every key value pair have a colon between them i.e., key: values to show which key and which value and each pair are separated by commas. It is mutable data type i.e., you can modify the values of the existing key or if the key is not present, you can add the new key value pair. Example: student = {    ...

Types of Database Models- Explained with Examples

Image
Types of Database Models- Explained with Examples Introduction A database system is a collection of related data along with programs that help users access, manage, and modify that data easily. The main goal of database system is to give users a simple and clear view of the data by hides how the data is actually stored and maintained internally i.e., the complex details. Here, the data model are used, these will be discussed in detail in the following section. Data Models The structure of a database is based on something called a data model. A data model is a set of concepts used to describe: how data is organized, how different data items are related, the meaning of data, rules to maintain data consistency. There are different types of data models, and they are generally classified into four main categories. Types of Database Models There are four main types: Hierarchical Model Network Model Relational Model Object-Oriented Model 1. Hierarchical Model In hierarchical model, data is or...

Introduction To Database Management System

  Introduction to Database Management System In engineering and computer science, DBMS (Database Management System) is one of the most important subjects. It is not only useful for exams like GATE and placement, but also essential for real-world software development. In this blog, we will cover: What is DBMS Why DBMS is needed Advantages of DBMS Application of DBMS Everything is explained in a simple and beginner-friendly way. What Is DBMS? A database-management system (DBMS) is a collection of interrelated data and a set of programs to access those data. The primary goal of a DBMS is to provide a way to store, manage and retrieve data easily. Some other operation can also be performed on database such as adding, updating and deleting data.  Instead of storing data in files, DBMS  stores data in structured format (tables). Examples of DBMS MySQL Oracle PostgreSQL SQL Server Why Do We Need DBMS? Earlier, data was stored using file systems, which caused many problems s...

Python Tuples- Immutable Date in Python

 Python Tuples - Store Data That Cannot Change Introduction In Python, we learned about lists, which allow us to store multiple values in a single variable and modify them later. But sometimes we need data that should not change during the program. For this purpose, Python provides Tuples. Tuples are similar to lists, but they are immutable, which means their values cannot be changed after creation. What Is a Tuple? A tuple is a collection of items separated by commas stored inside parentheses( ). It is immutable. Example: numbers = (10, 20, 30,40) print(numbers) Output: (10, 20, 30, 40) Tuple Can Store Different Data Types Just like lists, tuples can store different types of data Example: data =("Python", 21, 85.5, True) print(data) A tuple can store: Strings Integers Floats Boolean values Creating Tuples To create a tuple put a number of expressions, separated by commas in parentheses. You can write in the form given below:   T= ( ) T=(value,) Create a Empty Tuple The empty...

Python Lists

Image
 Python List- Store Multiple Value Easily Introduction Until now, we stored single values only using variable. But what if you want to store marks of 5 subjects? Will you create 5 variables for that. No, Instead, Python gives us something powerful: Lists . List allow us to store multiple values in a single variable. What Is a List? A list is a standard data type in python that can store a sequence of values separated by commas inside square brackets [ ]. It can store different data types. For  example: data= ["happy", 21, 85.6, True] List can store strings, integers, floats, Boolean, even other lists. List are mutable i.e., you can change the values present in the list. Creating Lists To create a list you have to put  number of expression, separated by commas inside the square brackets as depicted in the following: L=[ ] L=[values, ......] To create empty list do as follows: L=list()  #It will generate empty list and the name of the list is L. You can also create a...