Python

OOPs in Python

OOPs in Python stand for Object-oriented programming aims to implement real-world entities like inheritance, polymorphism, etc in programming. The main aim of OOP is to bind together the data and the functions that operate on them so that no other part of the code can access this data except that function.

Python

String in Python

The most commonly used object in any project and in any programming language is String only. A string is a list of characters in order enclose by single quote, double quote or triple quotes. Python string is immutable modifications are not allow once it is create. String index starts from 0, it support both forward and backward indexing. Each character is encoded in the ASCII or Unicode character. Strings are use widely in many different applications, such as storing and manipulating text data, representing names, addresses, and other types of data that can be represent as text.

Python

Dictionary in Python

List, tupple ,set data types are use to represent individual objects as a single entity. To store the group of objects as a key-value pairs use dictionary. Declare the dictionary data within the curly braces, each key separate with value by using : (colon) & each element is separate with comma. A dictionary is a data type similar to arrays, but works with keys & values instead of indexes. The keys must be unique keys but values can be duplicate. The values in the dictionary can be of any type while the keys must be immutable like numbers, tuples or strings. Dictionary keys are case sensitive- Same key name but with the different case are treat as different keys in Python dictionaries.

Python

Tuple in Python

Tuple can store both homogeneous & heterogeneous data. Insertion order is preserve it means in which order we insert data same order output is print. Tuple allows duplicate objects. The tuple contains forward indexing & backward indexing. This is immutable modifications are not allow. Declared within the parenthesis ( ). Tuples are order sequences, each element has a specific order that will never change.

Python

List in Python

List is use to store the group of values. A list can be compose by storing a sequence of different type of values separated by commas. List is mutable object so we can do the manipulations. A list is enclose between square [] brackets. In list insertion order is preserve it means in which order we insert element same order output is print. A List duplicate objects are allowed. The list contains forward indexing & backward indexing.