Some Basic Python List Programs-2

Some Basic List Programs

Python program to copy a list list1 = [9, 4, 10, 5] list2 = list(list1) print(“Original list: “,list1) print(“Copied list: “,list2) #Output: Original list: [9, 4, 10, 5] Copied list: [9, 4, 10, 5] The list() built-in method takes an iterable and creates a new list of its elements. Python program to concatenate multiple lists … Read more

Set Data Type in Python

Set Data Type in Python

Python Sets Mathematically a set is a collection of elements, not having any particular order. A Python set is an unordered collection of immutable and unique elements. As the set elements are usually not stored in order of appearance in the set, so there is no index attached to any element. Thus they do not … Read more

Some Basic Python Tuple Programs-1

Some basic tuple programs

Tuple A tuple is an immutable and sequential collection of data that can be indexed and sliced. Python tuple can contain homogeneous as well as heterogeneous values of data types such as integers, floats, strings, lists, and dictionaries. Python Program to concatenate multiple tuples tup1 = (7, 1, 9) tup2 = (5, 2, 3, 4, … Read more

Slicing in python

Slicing

Slicing Slicing extracts a subset of elements from a sequence. In python, elements are sliced based on their index in the stream. As a sequence(List, tuple, and string) is an ordered stream of data, it can be indexed and sliced while a collection(Set and dictionary) is an unordered stream of data, thus they can’t be … Read more

Python Object Oriented Programming

PYTHON : OOPs Python is a multi-paradigm programming language. It means that Python supports different programming approach. Python Object Oriented Programming approach (OOPs) is the ¬†easiest and the most popular one among them . Introduction to OOPs Object Oriented Programming is referred as a programming approach , where the programs are organised as objects. This … Read more

%d bloggers like this: