It is an encapsulation mechanism to group related modules into a single unit. package is nothing but folder or directory which represents collection of Python modules. Any folder or directory contains __init__.py file,is considered as a Python package. This file can be empty. A package can contains sub packages also.Continue Reading

Modules A group of functions, variables and classes saved to a file, which is nothing but module. Every Python file (.py) acts as a module. Ex: dharshimath.pyx=888def add(a,b): print(“The Sum:”,a+b)def product(a,b): print(“The Product:”,a*b) dharshimath module contains one variable and 2 functions. If we want to use members of module inContinue Reading

Recursive Functions A function that calls itself is known as Recursive Function. Ex: factorial(3)=3*factorial(2) =3*2*factorial(1) =3*2*1*factorial(0) =3*2*1*1 =6 factorial(n)= nfactorial(n-1) The main advantages of recursive functions are: We can reduce length of the code and improves readability We can solve complex problems very easily. Q. Write a Python Function toContinue Reading

FUNCTIONS If a group of statements is repeatedly required then it is not recommended to write these statements every timeseparately.We have to define these statements as a single unit and we can call that unit any number of times based on our requirement without rewriting. This unit is nothing butContinue Reading

Dictionary Data Structure We can use List, Tuple and Set to represent a group of individual objects as a single entity. If we want to represent a group of objects as key-value pairs then we should go for Dictionary. Ex:rollno—-namephone number–addressipaddress—domain name Duplicate keys are not allowed but values canContinue Reading

Set  Data Structure If we want to represent a group of unique values as a single entity then we should go for set. Duplicates are not allowed. Insertion order is not preserved. But we can sort the elements. Indexing and slicing not allowed for the set. Heterogeneous elements are allowed.Continue Reading

Tuple is exactly same as List except that it is immutable. i.e once we creates Tuple object,we cannot perform any changes in that object. Hence Tuple is Read Only version of List. If our data is fixed and never changes then we should go for Tuple. Insertion Order is preservedContinue Reading

If we want to represent a group of individual objects as a single entity where insertion order preserved and duplicates are allowed, then we should go for List. insertion order preserved. duplicate objects are allowed heterogeneous objects are allowed. List is dynamic because based on our requirement we can increaseContinue Reading

String Data Type The most commonly used object in any project and in any programming language is String only.Hence we should aware complete information about String data type. What is String? Any sequence of characters within either single quotes or double quotes is considered as a String. Syntax: s=’seedgroup’ s=”seedgroup”Continue Reading

If we want to execute a group of statements multiple times then we should go for Iterative statements. Here, we will discuss 4 types of Python Loop: Python For Loop Python While Loop Python Loop Control Statements Nested For Loop in Python While Loop: A while loop in python iteratesContinue Reading