├── MyFiles └── Lectures │ ├── file5.txt │ ├── file3.txt │ ├── file1.txt │ ├── file4.txt │ └── file2.txt ├── Lessons ├── pep8.py ├── FirstProgram.py ├── __pycache__ │ └── multiprocessing.cpython-311.pyc ├── UserInput.py ├── ShortIfElse.py ├── CustomError.py ├── Generators.py ├── Staticmethods.py ├── ShutilModule.py ├── FunctionCaching.py ├── TimeModule.py ├── BreakContinue.py ├── Importing.md ├── docStrings.py ├── ElseWithLoops.py ├── VariablesDataTypes.py ├── Loops.py ├── ErrorHandling.py ├── MethodOverriding.py ├── OperatorOverloading.py ├── Sets.py ├── String-Slicing.py ├── multiprocessing.py ├── HybridInheritance.py ├── LocalGlobal.py ├── ListsInPython.py ├── Recursion.py ├── MatchCases.py ├── String.py ├── Functions.py ├── HierarchicalInheritance.py ├── ClassMethodAsAlternativeConstructor.py ├── f-Strings.py ├── is and equal.py ├── AccessModifiers.py ├── VirtualEnvironment.md ├── CommentsEscapeSequence.py ├── SingleInheritance.py ├── If__Name__and__main__.md ├── RequestsModule.py ├── dir-dict-help-methods.py ├── Constructor.py ├── FinallyKeyword.py ├── Inheritance.py ├── ClassesandObjects.py ├── ClassMethods.py ├── MultipleInheritance.py ├── EnumerateFunction.py ├── IfElse.py ├── walrusoperator.py ├── TuplesInPython.py ├── InstanceVsClassVariable.py ├── Decorators.py ├── ListsMethods.py ├── IntroOOP'S.md ├── FunctionArguments.py ├── MultiLevelInheritance.py ├── TypeCasting.py ├── LambdaFunction.py ├── GettersandSetters.py ├── SuperKeyword.py ├── DictionariesInPython.py ├── dundermethods.py ├── RegularExpression.py ├── StringMethods.py ├── SetMethods.py └── FileOperations.py ├── Exercises ├── clutteredFolder │ ├── 1.png │ ├── 2.png │ ├── 3.png │ └── 4.png ├── Ex1-SimpleCalculator1.py ├── Ex1-SimpleCalculator2.py ├── Ex2-GivesTiming.py ├── clutter.py ├── snakegame.py ├── books.py ├── NewsAPI.py └── KBC.py └── README.md /MyFiles/Lectures/file5.txt: -------------------------------------------------------------------------------- 1 | This Is Tr -------------------------------------------------------------------------------- /MyFiles/Lectures/file3.txt: -------------------------------------------------------------------------------- 1 | My File name is File3. 2 | -------------------------------------------------------------------------------- /MyFiles/Lectures/file1.txt: -------------------------------------------------------------------------------- 1 | Welcome, My Python Programming. 2 | -------------------------------------------------------------------------------- /MyFiles/Lectures/file4.txt: -------------------------------------------------------------------------------- 1 | Line1 2 | Line2 3 | Line3 4 | Line4 5 | -------------------------------------------------------------------------------- /MyFiles/Lectures/file2.txt: -------------------------------------------------------------------------------- 1 | Hello, My name is Shubham!! 2 | Hey brother, How are you? -------------------------------------------------------------------------------- /Lessons/pep8.py: -------------------------------------------------------------------------------- 1 | #PEP(Python Enhancement Proposal) 2 | 3 | import this 4 | 5 | # The Zen Of Python -------------------------------------------------------------------------------- /Exercises/clutteredFolder/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shubham-Bhoite/Python-Programming/main/Exercises/clutteredFolder/1.png -------------------------------------------------------------------------------- /Exercises/clutteredFolder/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shubham-Bhoite/Python-Programming/main/Exercises/clutteredFolder/2.png -------------------------------------------------------------------------------- /Exercises/clutteredFolder/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shubham-Bhoite/Python-Programming/main/Exercises/clutteredFolder/3.png -------------------------------------------------------------------------------- /Exercises/clutteredFolder/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shubham-Bhoite/Python-Programming/main/Exercises/clutteredFolder/4.png -------------------------------------------------------------------------------- /Lessons/FirstProgram.py: -------------------------------------------------------------------------------- 1 | print("Hello World") 2 | print("Shubham Bhoite") 3 | print("Shivaji Maharaj" "96k") 4 | print(5,3,9,63 ,sep="~") -------------------------------------------------------------------------------- /Lessons/__pycache__/multiprocessing.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shubham-Bhoite/Python-Programming/main/Lessons/__pycache__/multiprocessing.cpython-311.pyc -------------------------------------------------------------------------------- /Exercises/Ex1-SimpleCalculator1.py: -------------------------------------------------------------------------------- 1 | X=40 2 | Y=20 3 | 4 | print("Addition",X+Y) 5 | print("Subtraction",X-Y) 6 | print("Multiplication",X*Y) 7 | print("Division",X/Y) 8 | print("Modulus",X%Y) -------------------------------------------------------------------------------- /Lessons/UserInput.py: -------------------------------------------------------------------------------- 1 | s = input("Enter your college name: ") 2 | print("My college name is", s) 3 | 4 | a = input("Enter first number: ") 5 | b = input("Enter second number: ") 6 | print(a + b) 7 | 8 | print(int(a) + int(b)) 9 | -------------------------------------------------------------------------------- /Lessons/ShortIfElse.py: -------------------------------------------------------------------------------- 1 | # Short Hand For If Else Statement 2 | 3 | a=11 4 | b=55 5 | print("A is Bigger") if a>b else print("Both Are same") if a==b else print("A is Smaller") 6 | 7 | # Store output value as variable 8 | outValue= 5 if a>b else 5 9 | print(outValue) 10 | -------------------------------------------------------------------------------- /Lessons/CustomError.py: -------------------------------------------------------------------------------- 1 | # We can produce custom error in python 2 | 3 | s=int(input("Enter any value between 20 to 35: ")) 4 | 5 | if(s<20 or s>35): 6 | raise ValueError("This sentence is a lie!!! Enter Number Between 10 to 20") 7 | else: 8 | print("You are the smart yahh!!!") -------------------------------------------------------------------------------- /Lessons/Generators.py: -------------------------------------------------------------------------------- 1 | def my_generator(): 2 | for i in range(10): 3 | yield i 4 | 5 | gen = my_generator() 6 | print(next(gen)) 7 | print(next(gen)) 8 | print(next(gen)) 9 | print(next(gen)) 10 | print(next(gen)) 11 | 12 | 13 | for j in gen: 14 | print(j) 15 | -------------------------------------------------------------------------------- /Lessons/Staticmethods.py: -------------------------------------------------------------------------------- 1 | # Methods that belong to class rather than instance of class 2 | # Need to give @staticmethod before declaring method 3 | 4 | class Math: 5 | @staticmethod 6 | def divide(a, b): 7 | return a / b 8 | 9 | result = Math.divide(15, 5) 10 | print(result) -------------------------------------------------------------------------------- /Lessons/ShutilModule.py: -------------------------------------------------------------------------------- 1 | # import shutil 2 | 3 | # # Copying a file 4 | # shutil.copy("src.txt", "dst.txt") 5 | 6 | # # Copying a directory 7 | # shutil.copytree("src_dir", "dst_dir") 8 | 9 | # # Moving a file 10 | # shutil.move("src.txt", "dst.txt") 11 | 12 | # # Deleting a directory 13 | # shutil.rmtree("dir") -------------------------------------------------------------------------------- /Lessons/FunctionCaching.py: -------------------------------------------------------------------------------- 1 | from functools import lru_cache 2 | import time 3 | 4 | @lru_cache(maxsize=None) 5 | def fx(n): 6 | time.sleep(4) 7 | return n*10 8 | 9 | 10 | print(fx(15)) 11 | print("done for 15") 12 | print(fx(5)) 13 | print("done for 5") 14 | print(fx(7)) 15 | print("done for 7") 16 | print("Thank You") 17 | 18 | -------------------------------------------------------------------------------- /Lessons/TimeModule.py: -------------------------------------------------------------------------------- 1 | # time.time(): 2 | import time 3 | print(time.time()) 4 | 5 | 6 | # time.sleep(): 7 | import time 8 | print("Start:", time.time()) 9 | time.sleep(4) 10 | print("End:", time.time()) 11 | 12 | # time.strftime(): 13 | import time 14 | t = time.localtime() 15 | formatted_time = time.strftime("%Y-%m-%d %H:%M:%S", t) 16 | print(formatted_time) 17 | -------------------------------------------------------------------------------- /Lessons/BreakContinue.py: -------------------------------------------------------------------------------- 1 | #Break Statement 2 | # Break is used to skip the loop 3 | for i in range(40): 4 | print(i ) 5 | if(i== 25): 6 | break 7 | else: 8 | print("Laii Bhaari!!!") 9 | print("Thank you") 10 | 11 | 12 | #Continue Statement 13 | for S in range(30): 14 | if(S%6==0): 15 | print("bye bye") 16 | continue 17 | print(S) -------------------------------------------------------------------------------- /Lessons/Importing.md: -------------------------------------------------------------------------------- 1 | # How import works 2 | - ==>import<== is the process of loading code from python module into current script. 3 | 4 | ## Different Ways to use import: 5 | import math 6 | from math import sqrt,pi 7 | from math import * 8 | import math as m 9 | 10 | --- 11 | import math 12 | print(dir(math)) #This prints all functions within math module -------------------------------------------------------------------------------- /Lessons/docStrings.py: -------------------------------------------------------------------------------- 1 | # Doc Strings Are written after function declaration and before function definition 2 | 3 | def squares(num): 4 | 5 | '''This is Paragraph #We can write any sentence if you want 6 | Line 1 7 | Line 2 8 | Line 3 ''' 9 | print("Square is: ",num**2) 10 | 11 | squares(15) 12 | 13 | print(squares.__doc__) #this will print Doc-Strings 14 | -------------------------------------------------------------------------------- /Lessons/ElseWithLoops.py: -------------------------------------------------------------------------------- 1 | #We Can Use Else Within The Loops 2 | 3 | #This Will Execute else after completing Loop 4 | for i in range(7): 5 | print(i) 6 | else: 7 | print("there is no any loop") 8 | 9 | #Else is not executed if we use Break in between loop 10 | for s in range(9): 11 | print(s) 12 | if(s==5): 13 | break 14 | else: 15 | ("there is no any loop") 16 | -------------------------------------------------------------------------------- /Lessons/VariablesDataTypes.py: -------------------------------------------------------------------------------- 1 | a=15 2 | print(a) 3 | b="Shubham" 4 | print(b) 5 | 6 | #Sequenced data types: Lists, Tuples 7 | 8 | list1= [8, 2.3, [-4,5],["Shubham"]] 9 | print(list1) #Mutable 10 | 11 | tuple1=(("X","Y","Z"),("Lion", "Tiger")) 12 | print(tuple1) #Immutable 13 | 14 | # Mapped Data Type = Dictionary (Key:Value Pair Of Data) 15 | dict1={"Name":"SHUBHAM","Age":22,"canDrive":True} 16 | print(dict1) -------------------------------------------------------------------------------- /Exercises/Ex1-SimpleCalculator2.py: -------------------------------------------------------------------------------- 1 | X = 50 2 | Y = 4 3 | 4 | print("The value of", X, "+", Y, "is: ", X + Y) 5 | print("The value of", X, "-", Y, "is: ", X - Y) 6 | print("The value of", X, "*", Y, "is: ", X * Y) 7 | print("The value of", X, "/", Y, "is: ", X / Y) 8 | print("The value of", X, "//", Y, "is: ", X // Y) 9 | print("The value of", X, "%", Y, "is: ", X % Y) 10 | print("The value of", X, "**", Y, "is: ", X ** Y) -------------------------------------------------------------------------------- /Exercises/Ex2-GivesTiming.py: -------------------------------------------------------------------------------- 1 | import time 2 | t = time.strftime('%H:%M:%S') 3 | hour = int(time.strftime('%H')) 4 | hour = int(input("Enter hour: ")) 5 | print(hour) 6 | 7 | if(hour>=0 and hour<12): 8 | print("Good Morning Sir!") 9 | elif(hour>=12 and hour<17): 10 | print("Good Afternoon Sir!") 11 | elif(hour>=17 and hour<0): 12 | print("Good Night Sir!") 13 | else: 14 | print("Time is Not Correct!!!") 15 | -------------------------------------------------------------------------------- /Lessons/Loops.py: -------------------------------------------------------------------------------- 1 | # For Loops ==> 2 | name='Shubham' 3 | for car in name : 4 | print(car) 5 | if (car=="h"): 6 | print("This is a special!") 7 | 8 | for k in range(8): 9 | print (k) 10 | 11 | for S in range(3, 6): 12 | print(S) 13 | 14 | for H in range(5,8): 15 | print (H+1) 16 | 17 | 18 | # While Loops ==> 19 | num=15 20 | while(num>0): 21 | print(num) 22 | num=num-1 23 | -------------------------------------------------------------------------------- /Lessons/ErrorHandling.py: -------------------------------------------------------------------------------- 1 | #Exception handling is the process of responding to unwanted or unexpected events when a computer program runs. 2 | # Used to deal with Errors 3 | 4 | try: 5 | num = int(input("Enter an integer: ")) 6 | a = [11, 45] 7 | print(a[num]) 8 | except ValueError: 9 | print("Number entered is not an integer.") 10 | 11 | except IndexError: 12 | print("Index Error") 13 | # We Can USe Multiple Except Statements -------------------------------------------------------------------------------- /Lessons/MethodOverriding.py: -------------------------------------------------------------------------------- 1 | # Allows you to redefine a method in derived class. 2 | 3 | class funds: 4 | def __init__(self, a, b): 5 | self.a = a 6 | self.b = b 7 | 8 | def addition(self): 9 | return self.a + self.b 10 | 11 | class income(funds): 12 | def __init__(self, GST): 13 | self.GST = GST 14 | super().__init__(GST, GST) 15 | 16 | tally = income(200) 17 | print(tally.addition()) 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /Lessons/OperatorOverloading.py: -------------------------------------------------------------------------------- 1 | class Vector: 2 | def __init__(self, i, j, k): 3 | self.i = i 4 | self.j = j 5 | self.k = k 6 | 7 | def __str__(self): 8 | return f"{self.i}i - {self.j}j - {self.k}k" 9 | 10 | def __sub__(self, x): 11 | return Vector(self.i - x.i, self.j-x.j, self.k-x.k) 12 | v1 = Vector(3, 5, 6) 13 | print(v1) 14 | 15 | v2 = Vector(1, 2, 4) 16 | print(v2) 17 | 18 | print(v1 - v2) 19 | print(type(v1 - v2)) 20 | 21 | -------------------------------------------------------------------------------- /Lessons/Sets.py: -------------------------------------------------------------------------------- 1 | # Unordered Collection Of Data. 2 | # Set does not maintain order. 3 | # Set Do Not Contain Duplicate Values 4 | # Sets Are Immutable 5 | 6 | set={3,5,8,0,11,22,33,44} 7 | print(set) 8 | 9 | # dictset={} This is Empty Dictionary 10 | # print(type(dictset)) 11 | 12 | # empset=set() This is Empty Set 13 | # print(type(empset)) 14 | 15 | 16 | #using for loop 17 | info = {"Carla", 19, False, 5.9} 18 | for item in info: 19 | print(item) 20 | -------------------------------------------------------------------------------- /Lessons/String-Slicing.py: -------------------------------------------------------------------------------- 1 | # Length od String 2 | fruit = "Banana" 3 | len1 = len(fruit) 4 | print("Banana is a", len1,"letter") 5 | 6 | 7 | # String-Slicing 8 | pie = "ApplePie" 9 | print(pie[:5]) #Slicing from Start 10 | print(pie[5:]) #Slicing till End 11 | print(pie[2:6]) #Slicing in between 12 | print(pie[-8:]) #Slicing using negative index 13 | 14 | 15 | # Loop through String 16 | alphabets = "XYZUS" 17 | for i in alphabets: 18 | print(i) -------------------------------------------------------------------------------- /Lessons/multiprocessing.py: -------------------------------------------------------------------------------- 1 | #Multiprocessing in Python: Multiprocessing is a Python module that provides a simple way to run multiple processes in parallel. 2 | 3 | 4 | #Importing Multiprocessing: 5 | import multiprocessing 6 | 7 | #Creating a process: 8 | import multiprocessing 9 | def my_func(): 10 | print("Hello from process", multiprocessing.current_process().name) 11 | process = multiprocessing.Process(target=my_func) 12 | process.start() 13 | process.join() 14 | -------------------------------------------------------------------------------- /Lessons/HybridInheritance.py: -------------------------------------------------------------------------------- 1 | class GrandPa: 2 | def __init__(self): 3 | print("GrandPa") 4 | 5 | class Father(GrandPa): 6 | def __init__(self): 7 | super().__init__() 8 | print("Father") 9 | 10 | class Mother(GrandPa): 11 | def __init__(self): 12 | super().__init__() 13 | print("Mother") 14 | 15 | 16 | class child(Father, Mother): 17 | def __init__(self): 18 | super().__init__() 19 | print("Child") 20 | 21 | c = child() -------------------------------------------------------------------------------- /Lessons/LocalGlobal.py: -------------------------------------------------------------------------------- 1 | # Local Variables are accessible into only particular function 2 | # Global Variable can be accessed from anywhere 3 | 4 | #Global Variable 5 | y=50 6 | def my_func(): 7 | x=20 #Local Variable 8 | print(x) 9 | my_func() 10 | #print(x) # This will throw error 11 | 12 | 13 | #How to change global variable from function 14 | change=100 15 | def change(): 16 | global char 17 | char=70 18 | change() 19 | print(char) # This Will Print Changed Value 20 | -------------------------------------------------------------------------------- /Exercises/clutter.py: -------------------------------------------------------------------------------- 1 | #Write a program to clear the clutter inside a folder on your computer. You should use os module to rename all the png images from 1.png all the way till n.png where n is the number of png files in that folder. 2 | 3 | import os 4 | 5 | files = os.listdir("Exercises/clutteredFolder") 6 | i = 1 7 | for file in files: 8 | if file.endswith(".png"): 9 | print(file) 10 | os.rename(f"Exercises/clutteredFolder/{file}", f"Exercises/clutteredFolder/{i}.png") 11 | i = i + 1 12 | -------------------------------------------------------------------------------- /Lessons/ListsInPython.py: -------------------------------------------------------------------------------- 1 | # Lists Are Collection Of Data Items 2 | # Contain any type of data type 3 | 4 | myList=[1,2,3,4,"Sandip",8.2,True] 5 | print(myList) 6 | 7 | #positive Indexing 8 | print(myList[4]) 9 | 10 | #Negative Indexing 11 | print(myList[-4]) 12 | 13 | # Check whether element is present or not 14 | if 4 in myList: 15 | print("Yes") 16 | else: 17 | print("No") 18 | 19 | 20 | #List Slicing 21 | print(myList[1:4]) 22 | print(myList[-3:-1]) 23 | 24 | #Jump index 25 | print(myList[0:6:2]) -------------------------------------------------------------------------------- /Lessons/Recursion.py: -------------------------------------------------------------------------------- 1 | #Function call itself called recursion. 2 | 3 | # factorial(7) = 7*6*4*4*3*2*1 4 | # factorial(6) = 6*4*4*3*2*1 5 | # factorial(4) = 4*4*3*2*1 6 | # factorial(4) = 4*3*2*1 7 | # factorial(0) = 1 8 | 9 | #Factorial Program 10 | 11 | def factorial(num): 12 | if(num==0 or num==1): 13 | return 1 14 | else: 15 | return num*factorial(num-1) # Recursion is Used 16 | 17 | print(factorial(4)) 18 | # 4 * factorial(3) 19 | # 4 * 3 * factorial(2) 20 | # 4 * 3 * 2 * factorial(1) 21 | # 4 * 3 * 2 * 1 -------------------------------------------------------------------------------- /Lessons/MatchCases.py: -------------------------------------------------------------------------------- 1 | myInput=int(input("Enter Your Roll Number : ")) 2 | 3 | match myInput: 4 | case 1: 5 | print(1) 6 | case 2: 7 | print(2) 8 | case 3: 9 | print(3) 10 | case 4: 11 | print(4) 12 | case 5: 13 | print(5) 14 | case 6: 15 | print(6) 16 | case 7: 17 | print(7) 18 | case 8: 19 | print(8) 20 | case 9: 21 | print(9) 22 | case 10: 23 | print(10) 24 | case _: 25 | print("You are Not a Student of Parikrama") 26 | -------------------------------------------------------------------------------- /Lessons/String.py: -------------------------------------------------------------------------------- 1 | # String are anything that are enclosed within double or single quotes 2 | 3 | name="SHUBHAM" 4 | print("Hello," + name) 5 | 6 | 7 | # Multiline Strings. 8 | a= """ My name is Shubham, 9 | Hi Shubham 10 | Hey i am good 11 | I want to eat an Apple""" 12 | print(a) 13 | 14 | # Accessing characters of string. 15 | name="Sunny" 16 | print (name[0]) 17 | print (name[1]) 18 | print (name[2]) 19 | print (name[3]) 20 | print (name[4]) 21 | 22 | # Looping in String. 23 | buddy ="Prashant" 24 | for character in buddy : 25 | print(character) -------------------------------------------------------------------------------- /Lessons/Functions.py: -------------------------------------------------------------------------------- 1 | #def ==> user defined function 2 | def malmulateGmean(x, y): 3 | mean = (x*y)/(x+y) 4 | print(mean) 5 | 6 | def isGreater(x, y): 7 | if(x>y): 8 | print("First number is greater") 9 | else: 10 | print("Semond number is greater or equal") 11 | 12 | def isLesser(x, y): 13 | pass 14 | 15 | 16 | x = 5 17 | y = 4 18 | isGreater(x, y) 19 | malmulateGmean(x, y) 20 | # gmean1 = (x*y)/(x+y) 21 | # print(gmean1) 22 | m = 9 23 | n = 55 24 | isGreater(m, n) 25 | malmulateGmean(m, n) 26 | # gmean2 = (m*n)/(m+n) 27 | # print(gmean2) -------------------------------------------------------------------------------- /Lessons/HierarchicalInheritance.py: -------------------------------------------------------------------------------- 1 | # base class 2 | 3 | class Animal(): 4 | def animal(self): 5 | print("I'm an Animal") 6 | 7 | # child class 1 8 | class Cat(Animal): 9 | def cat(self): 10 | print("I'm a cat Meow Meow!") 11 | 12 | # child class 2 13 | class Dog(Animal): 14 | def dog(self): 15 | print("I'm a dog Brak Bark!") 16 | 17 | # create object of child classes 18 | cat = Cat() 19 | dog = Dog() 20 | 21 | print("Cat") 22 | cat.animal() 23 | cat.cat() 24 | 25 | print("\nDog") 26 | dog.animal() 27 | dog.dog() 28 | -------------------------------------------------------------------------------- /Lessons/ClassMethodAsAlternativeConstructor.py: -------------------------------------------------------------------------------- 1 | # We can use class Method as a constructor alternative 2 | 3 | class StudentData: 4 | def __init__(self,name,branch): 5 | self.name=name 6 | self.branch=branch 7 | 8 | def showDetails(self): 9 | print(f"Student {self.name} is from {self.branch} Branch") 10 | 11 | @classmethod 12 | def stringSplitter(cls,string): 13 | return cls(string.split("/")[0],string.split("/")[1]) 14 | 15 | string="Shubham/CSE" 16 | std1=StudentData.stringSplitter(string) 17 | std1.showDetails() 18 | -------------------------------------------------------------------------------- /Lessons/f-Strings.py: -------------------------------------------------------------------------------- 1 | # f-Strings Are Used to manipulate the strings in python 2 | 3 | #Before f-strings 4 | intro="Hello My Name is {} and I am From {}" 5 | name="Shubham" 6 | country="India" 7 | print(intro.format(name,country)) # Right 8 | print(intro.format(country,name)) #Wrong 9 | 10 | 11 | #after f-Strings 12 | company="TCS" 13 | Role="SDE" 14 | myIntro=f"Hey Everybody, I got placed in {company} for {Role}" 15 | print(myIntro) 16 | 17 | print(f"{5*9}") #data type is String 18 | 19 | #printing as it is f-strings 20 | self=f"Hi!!! There I am {{name}}" 21 | print(self) 22 | -------------------------------------------------------------------------------- /Lessons/is and equal.py: -------------------------------------------------------------------------------- 1 | # "is" and "==" are both comparison operators. 2 | # "is" used to compare location of object in memory 3 | # "==" used to compare value of an objects 4 | # "is" Shows True if object is not changeable(tuples,etc) 5 | 6 | print("For Lists: ") 7 | lst1=[1,2,3,4,5] 8 | lst2=[1,2,3,4,5] 9 | 10 | print("Is Memory Location Same: ",lst1 is lst2) 11 | print("Are Values Same: ",lst1 == lst2) 12 | 13 | print("\nFor Tuples: ") 14 | tup1=(1,2,3,4,5) 15 | tup2=(1,2,3,4,5) 16 | 17 | print("Is Memory Location Same: ",tup1 is tup2) 18 | print("Are Values Same: ",tup1 == tup2) 19 | -------------------------------------------------------------------------------- /Lessons/AccessModifiers.py: -------------------------------------------------------------------------------- 1 | # Public --> 2 | # Can Be Accessed from anywhere 3 | # Default Access Modifier 4 | 5 | # Private --> 6 | # Only Accessible within class 7 | # Private consider by double underscore(__) 8 | 9 | # Protected --> 10 | # It accessible with class and subclass 11 | # Protected consider by single underscore(_) 12 | 13 | 14 | class Animals: 15 | def __init__(self): 16 | self._privateAtr="I am Private" 17 | self.__mangledAtr="I am Mangled" 18 | 19 | s1=Animals() 20 | print(s1._privateAtr) 21 | print(s1._Animals__mangledAtr) 22 | print(s1.__mangledAtr) 23 | -------------------------------------------------------------------------------- /Lessons/VirtualEnvironment.md: -------------------------------------------------------------------------------- 1 | # Virtual Environment in Python 2 | - Virtual environment is tool used to isolate specific python environment on single machine. 3 | 4 | ## How To Create Virtual Environment 5 | python -m venv myenv 6 | 7 | ## Start Virtual Environment 8 | myenv\Scripts\activate.bat 9 | 10 | ## Deactivate Virtual Environment 11 | deactivate 12 | ---- 13 | 14 | # Requirements TXT: 15 | - List all packages with versions 16 | 17 | ## How To Create 18 | pip freeze > requirements.txt 19 | 20 | ## How to use requirements.txt 21 | pip install -r requirements.txt -------------------------------------------------------------------------------- /Lessons/CommentsEscapeSequence.py: -------------------------------------------------------------------------------- 1 | # 1) This is a 'Single-Line Comment' ==> '''' or # 2 | print("Arjun and Prashant is my best friend.") 3 | 4 | # 2) This is Multi-Line Comment ==> """" or '''' or # 5 | 6 | """This is an if-else statement. 7 | It will execute a block of code if a specified condition is true. 8 | If the condition is false then it will execute another block of code.""" 9 | p = 7 10 | if (p > 5): 11 | print("p is greater than 5.") 12 | else: 13 | print("p is not greater than 5.") 14 | 15 | 16 | # Escape Sequence Characters ==> \n 17 | print("Rahuri is a city.\nAhmednagar is also a city.") 18 | 19 | 20 | -------------------------------------------------------------------------------- /Lessons/SingleInheritance.py: -------------------------------------------------------------------------------- 1 | class Sun: 2 | def __init__(self, name, types): 3 | self.name = name 4 | self.types = types 5 | 6 | def gives_water(self): 7 | print("Earth gives water.") 8 | 9 | 10 | class Earth(Sun): 11 | def __init__(self, name, pressure): 12 | Sun.__init__(self, name, types="Earth") 13 | self.pressure = pressure 14 | 15 | def gives_water(self): 16 | print("Gravitional force is present!!") 17 | 18 | 19 | d = Earth("Earth", "pressure") 20 | d.gives_water() 21 | 22 | a = Sun("Earth", "Mars") 23 | a.gives_water() -------------------------------------------------------------------------------- /Lessons/If__Name__and__main__.md: -------------------------------------------------------------------------------- 1 | # if "__ name__ == "__ main__" in Python 2 | 3 | - Before executing code, Python interpreter reads source file and define few special variables/global variables. 4 | 5 | - If the python interpreter is running that module (the source file) as the main program, it sets the special __ name __ variable to have a value __ main __. If this file is being imported from another module, __ name __ will be set to the module’s name. Module’s name is available as value to __ name __ global variable. 6 | 7 | - A module is a file containing Python definitions and statements. The file name is the module name with the suffix .py appended. -------------------------------------------------------------------------------- /Lessons/RequestsModule.py: -------------------------------------------------------------------------------- 1 | ##Using Get Request: 2 | import requests 3 | response = requests.get("https://www.google.com") 4 | print(response.text) 5 | 6 | 7 | 8 | ##Using POST Request: 9 | import requests 10 | 11 | url = "https://api.example.com/login" 12 | headers = { 13 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36", 14 | "Content-Type": "application/json" 15 | } 16 | data = { 17 | "username": "myusername", 18 | "password": "mypassword" 19 | } 20 | 21 | response = requests.post(url, headers=headers, json=data) 22 | 23 | print(response.text) -------------------------------------------------------------------------------- /Lessons/dir-dict-help-methods.py: -------------------------------------------------------------------------------- 1 | #The dir() function returns a list of all the attributes and methods (including dunder methods) available for an object. 2 | x = [1, 2, 3] 3 | print(dir(x)) 4 | 5 | 6 | #The __dict__ attribute returns a dictionary representation of an object's attributes. It is a useful tool for introspection. 7 | class Person: 8 | def __init__(self, name, age): 9 | self.name = name 10 | self.age = age 11 | 12 | p = Person("Shubham", 21) 13 | print(p.__dict__) 14 | 15 | 16 | #The help() function is used to get help documentation for an object, including a description of its attributes and methods. 17 | print(help(Person)) -------------------------------------------------------------------------------- /Lessons/Constructor.py: -------------------------------------------------------------------------------- 1 | # Special Method in a class used to create and initialize an object of a class 2 | # Constructor is invoked automatically when an object is created 3 | #syntax==> def __init__(self): 4 | 5 | # Types: 1) Default 2)Parameterized 6 | 7 | #1) Parameterized constructor: 8 | class Details: 9 | def __init__(self, birds, group): 10 | self.birds = birds 11 | self.group = group 12 | 13 | obj1 = Details("Sparrow", "birds") 14 | print(obj1.birds, "belongs to the", obj1.group, "group.") 15 | 16 | 17 | #2) Default constructor: 18 | class info: 19 | def __init__(self): 20 | print("Hello! Shubham, How are You?") 21 | obj1=info() -------------------------------------------------------------------------------- /Exercises/snakegame.py: -------------------------------------------------------------------------------- 1 | import random 2 | 3 | def check(comp, user): 4 | if comp ==user: 5 | return 0 6 | 7 | if(comp == 0 and user ==1): 8 | return -1 9 | 10 | if(comp == 1 and user ==2): 11 | return -1 12 | 13 | if(comp == 2 and user == 0): 14 | return -1 15 | 16 | return 1 17 | 18 | 19 | comp = random.randint(0, 2) 20 | user = int(input("0 for Snake, 1 for water and 2 for Gun:\n")) 21 | 22 | score = check(comp, user) 23 | 24 | print("You: ", user) 25 | print("Computer: ", comp) 26 | 27 | if(score == 0): 28 | print("Its a draw") 29 | elif (score == -1): 30 | print("You Lose") 31 | else: 32 | print("You Won") 33 | 34 | -------------------------------------------------------------------------------- /Lessons/FinallyKeyword.py: -------------------------------------------------------------------------------- 1 | # Finally is used to run block of code after try catch block 2 | # It used in functions 3 | 4 | s=int(input("Enter one Number :")) 5 | s1=int(input("Enter another Number :")) 6 | 7 | try: 8 | print("Addition of Numbers is",s+s1) 9 | except: 10 | print("Enter Non zero Number!!!") 11 | finally: 12 | print("I am always for you!!!") 13 | 14 | # Finally will run after running or using return function 15 | def alpha(a,b): 16 | try: 17 | print(f"{a}*{b} :",a*b) 18 | return 1 19 | except: 20 | print("my pleasure!!") 21 | return 0 22 | finally: 23 | print("Hey Dear, I always for you!!") 24 | 25 | s=int(input("Enter a: ")) 26 | s1=int(input("Enter b: ")) 27 | x=alpha(s,s1) 28 | print(x) 29 | -------------------------------------------------------------------------------- /Lessons/Inheritance.py: -------------------------------------------------------------------------------- 1 | # One Class is derive from another class 2 | # It Inherits all public and protected methods from parent class 3 | 4 | #Syntax--> 5 | # class BaseClass: 6 | # Body of base class 7 | # class DerivedClass(BaseClass): 8 | # Body of derived class 9 | 10 | #Example--> 11 | class Employee: 12 | def __init__(self, name, id): 13 | self.name = name 14 | self.id = id 15 | 16 | def showDetails(self): 17 | print(f"The name of Employee: {self.id} is {self.name}") 18 | 19 | class Programmer(Employee): 20 | def showLanguage(self): 21 | print("The default langauge is Python") 22 | 23 | 24 | e1 = Employee("Arjun Kadam", 123) 25 | e1.showDetails() 26 | e2 = Programmer("Prashant Jagtap", 321) 27 | e2.showDetails() 28 | e2.showLanguage() 29 | -------------------------------------------------------------------------------- /Lessons/ClassesandObjects.py: -------------------------------------------------------------------------------- 1 | class myinfo: 2 | name = "Shubham" 3 | occupation = "Web Developer" 4 | networth = 100 5 | def myinfo(self): 6 | print(f"{self.name} is a {self.occupation}") 7 | 8 | a = myinfo() 9 | b = myinfo() 10 | 11 | a.name = "Prashant" 12 | a.occupation = "Blockchain Developer" 13 | 14 | # print(a.name, a.occupation) 15 | a.myinfo() 16 | b.myinfo() 17 | 18 | 19 | # self parameter: #-->The self parameter is a reference to the current instance of the class, and is used to access variables that belongs to the class. 20 | class Details: 21 | name = "komal" 22 | age = 21 23 | 24 | def desc(self): 25 | print("My name is", self.name, "and I'm", self.age, "years old.") 26 | 27 | obj1 = Details() 28 | obj1.desc() 29 | 30 | 31 | -------------------------------------------------------------------------------- /Exercises/books.py: -------------------------------------------------------------------------------- 1 | #Write a Library class with no_of_books and books as two instance variables. Write a program to create a library from this Library class and show how you can print all books, add a book and get the number of books using different methods. 2 | 3 | class Library: 4 | def __init__(self): 5 | self.noBooks = 0 6 | self.books = [] 7 | 8 | def addBook(self, book): 9 | self.books.append(book) 10 | self.noBooks = len(self.books) 11 | 12 | def showInfo(self): 13 | print(f"The library has {self.noBooks} books. The books are") 14 | for book in self.books: 15 | print(book) 16 | 17 | 18 | l1 = Library() 19 | l1.addBook("Mrityunjaya ") 20 | l1.addBook("Be Made Into Movies.") 21 | l1.addBook("The Hunger Games") 22 | l1.showInfo() 23 | 24 | -------------------------------------------------------------------------------- /Lessons/ClassMethods.py: -------------------------------------------------------------------------------- 1 | # Type of method that is bound to the class and not the instance of class 2 | 3 | # Type of method that is bound to the class and not the instance of class 4 | 5 | class country_Data: 6 | states="Maharashtra" 7 | def personName(self): 8 | print(f"My name is {self.name} and I lived in {self.states}") 9 | 10 | @classmethod 11 | def changeState(cls,NewState): 12 | cls.states=NewState 13 | 14 | person1=country_Data() 15 | person1.name="Shubham" 16 | person1.personName() 17 | 18 | person2=country_Data() 19 | person2.name="Akshay" 20 | person2.changeState("Delhi") 21 | person2.personName() 22 | 23 | print(country_Data.states) # states Changed For Other Instances too 24 | 25 | person3=country_Data() 26 | person3.name="Rahul" 27 | person3.personName() -------------------------------------------------------------------------------- /Lessons/MultipleInheritance.py: -------------------------------------------------------------------------------- 1 | class Animal: 2 | def __init__(self, name, species): 3 | self.name = name 4 | self.species = species 5 | 6 | def make_sound(self): 7 | print("Sound made by the animal") 8 | 9 | class Mammal: 10 | def __init__(self, name, body_color): 11 | self.name = name 12 | self.body_color = body_color 13 | 14 | class Dog(Animal, Mammal): 15 | def __init__(self, name, breed, body_color): 16 | Animal.__init__(self, name, species="Dog") 17 | Mammal.__init__(self, name, body_color) 18 | self.breed = breed 19 | 20 | def make_sound(self): 21 | print("Bark!") 22 | 23 | o = Mammal("Shera", "Black") 24 | print(o.name) 25 | print(o.body_color) 26 | 27 | print(Mammal.mro()) -------------------------------------------------------------------------------- /Lessons/EnumerateFunction.py: -------------------------------------------------------------------------------- 1 | # By Using Enumerate Function we can extract index of list 2 | 3 | marks=[10,12,34,56,88,99,13] 4 | 5 | for index,mark in enumerate(marks): 6 | print(mark) 7 | if(index==5): 8 | print("You are Smart!!!") 9 | 10 | 11 | marks = [12, 56, 32, 98, 12, 45, 1, 4] 12 | 13 | for index, mark in enumerate(marks, start=1): 14 | print(mark) 15 | if(index == 3): 16 | print("Hello, Shubham!") 17 | 18 | 19 | 20 | # Loop over a tuple and print the index and value of each element 21 | colors = ('red', 'green', 'blue') 22 | for index, color in enumerate(colors): 23 | print(index, color) 24 | 25 | 26 | # Loop over a string and print the index and value of each character 27 | s = 'hello' 28 | for index, c in enumerate(s): 29 | print(index, c) 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /Lessons/IfElse.py: -------------------------------------------------------------------------------- 1 | #If Else 2 | car=int(input("Enter Your Car Count : ")) 3 | if(car>=3): 4 | print("Congratulation! You can Purchase more Cars") 5 | if(car>5): 6 | print("You are Rich Person") 7 | 8 | else: 9 | print("Sorry!! You cannot Purchase More Cars\n") 10 | 11 | 12 | #elif 13 | 14 | myInput=int(input("Enter Any Number: ")) 15 | if(myInput<0): 16 | print("The Number is Negative") 17 | elif(myInput==0): 18 | print("The Number is Zero") 19 | else: 20 | print("Number is Positive") 21 | 22 | 23 | #Nested if Statements 24 | 25 | num = 8 26 | if (num < 0): 27 | print("Number is negative.") 28 | elif (num > 0): 29 | if (num <= 10): 30 | print("Number is between 1-10") 31 | else: 32 | print("Number is greater than 11") 33 | else: 34 | print("Number is zero") -------------------------------------------------------------------------------- /Exercises/NewsAPI.py: -------------------------------------------------------------------------------- 1 | #Use the NewsAPI and the requests module to fetch the daily news related to different topics 2 | 3 | import requests 4 | import json 5 | 6 | while True: 7 | query = input("What type of news you want to hear(enter 0 to exit) : ") 8 | if query == "0": 9 | break 10 | url = f"https://newsapi.org/v2/everything?q={query}&from=2023-04-02&sortBy=publishedAt&apiKey=1bfa2c3570f74297a6e3c58a5bf92d65" 11 | r = requests.get(url) 12 | news = json.loads(r.text) 13 | 14 | if 'articles' in news: 15 | for article in news["articles"]: 16 | print("------------------") 17 | print(article["title"]) 18 | print(article["description"]) 19 | print("-------------------") 20 | 21 | else: 22 | print("No articles found for your query. Please try again.!") -------------------------------------------------------------------------------- /Lessons/walrusoperator.py: -------------------------------------------------------------------------------- 1 | # walrus operator denoted by (:=) 2 | #Walrus Operator reduce the code duplication. 3 | 4 | 5 | #Without Walrus Operator==> 6 | Animals = list() 7 | while True: 8 | animal = input("What animal do you like?: ") 9 | if animal == "stop": 10 | break 11 | Animals.append(animal) 12 | 13 | 14 | # #With Walrus Operator==> 15 | Animals = list() 16 | while (animal := input("What animal do you like?: ")) != "stop": 17 | Animals.append(animal) 18 | 19 | 20 | #Walrus Operator in a while loop: 21 | numbers = [1, 2, 3, 4, 5] 22 | 23 | while (n := len(numbers)) > 0: 24 | print(numbers.pop()) 25 | 26 | #Walrus Operator in an if statement: 27 | names = ["Shubham", "Vaishnavi", "Rohan"] 28 | 29 | if (name := input("Enter a name: ")) in names: 30 | print(f"Hello, {name}!") 31 | else: 32 | print("Name not found.") -------------------------------------------------------------------------------- /Lessons/TuplesInPython.py: -------------------------------------------------------------------------------- 1 | #Tuples are similar to lists but tuples are not change. 2 | #Tuples are Immutable. 3 | 4 | Tuple1=(5,2,7,9,1,6,5,9,0,2) 5 | print(Tuple1) 6 | Tuple2=("Shubham",9.1, True, 15) 7 | print(Tuple2) 8 | Tuple3=(3,) 9 | print(Tuple3) 10 | 11 | #It Has Same Indexing operation like Lists 12 | 13 | #indirect way to change Tuple 14 | 15 | originalTuple=(11,22,33,44,55) 16 | tempList=list(originalTuple) #convert tuple to List 17 | tempList.append(66) #modify List 18 | 19 | originalTuple=tuple(tempList) #Convert List into Tuple 20 | print(tempList) 21 | 22 | 23 | #concatenate two Tuples 24 | mytup1=("Shubham ") 25 | mytup2=("Bhoite") 26 | names=mytup1+mytup2 27 | print(names) 28 | 29 | 30 | 31 | #Tuple Methods 32 | 33 | #Gives the count of given value 34 | print(Tuple1.count(5)) 35 | 36 | #index of given value 37 | print(Tuple1.index(7)) 38 | -------------------------------------------------------------------------------- /Lessons/InstanceVsClassVariable.py: -------------------------------------------------------------------------------- 1 | # Class Variables defined outside to the class and shared among all methods belong to class 2 | # Instance Variables defined atr instance level and are unique to each instance of class 3 | 4 | class OrganizationData: 5 | OrgName="World Health Organization" # Class Variable 6 | def __init__(self,name,location): 7 | self.name=name 8 | self.id=222 9 | self.location=location # Instance Variable 10 | 11 | def ShowOrganizationDetails(self): 12 | print(f" ID No: {self.id} is {self.name} from {self.location} and organization is {self.OrgName}.") 13 | 14 | cus1=OrganizationData("Shubham","Rahuri") 15 | cus1. ShowOrganizationDetails() 16 | 17 | cus2=OrganizationData("Varad","Pune") 18 | cus2.OrgName="CID" # Not Necessary to change 19 | cus2.location="pune" 20 | cus2.id=444 21 | cus2.ShowOrganizationDetails() -------------------------------------------------------------------------------- /Lessons/Decorators.py: -------------------------------------------------------------------------------- 1 | # Python decorators are powerful and versatile tool that allows you to modify the behavior of functions and methods 2 | # It takes another function as an arguments 3 | 4 | def begineer(fx): 5 | 6 | def newFun(*a,**b): 7 | print(" Thanks for visiting my profile!!") 8 | fx(*a,**b) 9 | return newFun 10 | 11 | @begineer 12 | def addfunction(a,b): 13 | print("The Addition is:", a+b) 14 | 15 | addfunction(5,4) 16 | 17 | 18 | 19 | #Example2==> 20 | 21 | def greet(fx): 22 | def mfx(*args, **kwargs): 23 | print("Good Morning") 24 | fx(*args, **kwargs) 25 | print("Thanks for using this function") 26 | return mfx 27 | 28 | @greet 29 | def hello(): 30 | print("Hello world") 31 | 32 | @greet 33 | def add(a, b): 34 | print(a+b) 35 | 36 | # greet(hello)() 37 | hello() 38 | # greet(add)(1, 2) 39 | add(1, 2) 40 | 41 | -------------------------------------------------------------------------------- /Lessons/ListsMethods.py: -------------------------------------------------------------------------------- 1 | 2 | myList=[5,6,3,9,11,34,95,4,7,2,10,15,88,44] 3 | print(myList) 4 | 5 | #sorting The List in Ascending 6 | myList.sort() 7 | print(myList) 8 | #sorting The List in descending 9 | myList.sort(reverse=True) 10 | print(myList) 11 | 12 | #reverse the list 13 | myList.reverse() 14 | print(myList) 15 | 16 | #Add new element at the end 17 | myList.append(1) 18 | print(myList) 19 | 20 | 21 | #Print given index of given element 22 | ind=myList.index(7) 23 | print(ind) 24 | 25 | #Occurrence of any element 26 | occ=myList.count(11) 27 | print(occ) 28 | 29 | #copying List 30 | List2=[21,22,23,24,25] 31 | copiedList=List2.copy() 32 | copiedList[0]=40 33 | print(copiedList) 34 | 35 | #list Inserting at given index 36 | #It does not change element but insert at that index 37 | List3=[60,70,80,90,100] 38 | print(List3) 39 | List3.insert(99,101) 40 | print(List3) 41 | -------------------------------------------------------------------------------- /Lessons/IntroOOP'S.md: -------------------------------------------------------------------------------- 1 | # Introduction to Object-oriented programming 2 | 3 | ## 1) Class: 4 | - A class is a blueprint or template for creating objects. 5 | - It defines the properties and methods that an object of that class. 6 | 7 | ## 2) Object: 8 | - An object is an instance of a class. 9 | - Object contains its own data and methods. 10 | 11 | ## 3) Encapsulation: 12 | - It means internal state of an object is hidden and can only be accessed or modified through the object's methods. 13 | 14 | ## 4) Inheritance: 15 | - It allows new classes to be created that inherit the properties and methods of an existing class. 16 | - This allows for code reuse and makes it easy to create new classes that have similar functionality to existing classes. 17 | 18 | ## 5) Polymorphism: 19 | - It means that objects of different classes can be treated as if they were objects of a common class. -------------------------------------------------------------------------------- /Lessons/FunctionArguments.py: -------------------------------------------------------------------------------- 1 | #Default arguments 2 | def name(fname, mname = "Shrikant ", lname = "Thackeray"): 3 | print("Jay Maharashtra,", fname, mname, lname) 4 | 5 | name("Raj") 6 | 7 | 8 | #Keyword arguments 9 | def name(fname, mname, lname): 10 | print("Namaste,", fname, mname, lname) 11 | 12 | name(mname = "Prasadrao", lname = "Tanpure", fname = " Prajakt") 13 | 14 | 15 | #Required arguments 16 | def name(fname, mname, lname): 17 | print("Mere Bhai aur Bahano,", fname, mname, lname) 18 | 19 | name("Narendra", "Damodardas", "Modi") 20 | 21 | 22 | #Variable-length arguments 23 | def name(*name): 24 | print("Hey Coder,", name[0], name[1], name[2]) 25 | 26 | name("Prashant", "Kantilal", "Jagtap") 27 | 28 | 29 | #return Statement 30 | def name(fname, mname, lname): 31 | return "Only Rashtrawadi, " + fname + " " + mname + " " + lname 32 | 33 | print(name("Sharad", "Govindrao", "Pawar")) -------------------------------------------------------------------------------- /Lessons/MultiLevelInheritance.py: -------------------------------------------------------------------------------- 1 | class Animal: 2 | def __init__(self, name, species): 3 | self.name = name 4 | self.species = species 5 | 6 | def show_details(self): 7 | print(f"Name: {self.name}") 8 | print(f"Species: {self.species}") 9 | 10 | class Dog(Animal): 11 | def __init__(self, name, breed): 12 | Animal.__init__(self, name, species="Dog") 13 | self.breed = breed 14 | 15 | def show_details(self): 16 | Animal.show_details(self) 17 | print(f"Breed: {self.breed}") 18 | 19 | class GoldenRetriever(Dog): 20 | def __init__(self, name, color): 21 | Dog.__init__(self, name, breed="Golden Retriever") 22 | self.color = color 23 | 24 | def show_details(self): 25 | Dog.show_details(self) 26 | print(f"Color: {self.color}") 27 | 28 | dog = GoldenRetriever("Shera", "Black") 29 | dog.show_details() -------------------------------------------------------------------------------- /Lessons/TypeCasting.py: -------------------------------------------------------------------------------- 1 | # Type Casting Means Converting One Data Type Into Another. 2 | # Implicit - Done By User or Programmer. 3 | # Explicit - Done By Python (Convert Smaller Data Type to Higher Data Type) 4 | 5 | x="3" 6 | y="4" 7 | print(x+y) #print string 8 | print(int(x)+int(y)) #print int after type-casting 9 | 10 | 11 | a=5 12 | b=9.1 13 | print(a+b) 14 | 15 | 16 | ### Example of Explicit typecasting ==> 17 | string = "15" 18 | number = 7 19 | string_number = int(string) #throws an error if the string is not a valid integer 20 | sum= number + string_number 21 | print("The Sum of both the numbers is: ", sum) 22 | 23 | 24 | ### Example of Implicit typecasting ==> 25 | # Python automatically converts==> a to integer 26 | a = 7 27 | print(type(a)) 28 | 29 | # Python automatically converts==> b to float 30 | b = 3.0 31 | print(type(b)) 32 | 33 | # Python automatically converts==> c to float as it is a float addition 34 | c = a + b 35 | print(c) 36 | print(type(c)) -------------------------------------------------------------------------------- /Lessons/LambdaFunction.py: -------------------------------------------------------------------------------- 1 | # Lambda Functions is a small anonymous function without a name 2 | 3 | int= lambda float:float*2 4 | print(int(5)) 5 | 6 | # we can pass function as an argument to another function 7 | def my_fun(name,value): 8 | print(10+name(value)) 9 | 10 | my_fun(lambda float:float*float,4) # Here We Have Passed Lambda Function as an argument 11 | 12 | 13 | 14 | # MAP Function 15 | # The map Function applies a function to each element in sequence & returns a new sequence containing transformed elements 16 | 17 | my_list=[1,2,3,4,5,6,7,8,9,10] 18 | cube=map(lambda int:int*int*int,my_list) 19 | print(tuple(cube)) 20 | 21 | 22 | # Filter Function 23 | # The filter function filters a sequence of element based on give predicate and returns a new sequence containing only the element that meet the predicate 24 | filterlist=list(filter(lambda int:int>5,my_list)) 25 | print(filterlist) 26 | 27 | # Reduce Function 28 | # Function takes two arguments and returns a single value 29 | from functools import reduce 30 | multivalue= reduce(lambda x,y:x+y,my_list) 31 | print(multivalue) -------------------------------------------------------------------------------- /Lessons/GettersandSetters.py: -------------------------------------------------------------------------------- 1 | #Getters--> 2 | class MyClass: 3 | def __init__(self, value): 4 | self._value = value 5 | 6 | @property 7 | def value(self): 8 | return self._value 9 | 10 | obj = MyClass(10) 11 | obj.value 12 | 10 13 | 14 | 15 | #Getters and Setters--> 16 | class MyClass: 17 | def __init__(self, value): 18 | self._value = value 19 | 20 | @property 21 | def value(self): 22 | return self._value 23 | 24 | @value.setter 25 | def value(self, new_value): 26 | self._value = new_value 27 | 28 | obj = MyClass(10) 29 | obj.value = 20 30 | obj.value 31 | 20 32 | 33 | #Example : 34 | class MyClass: 35 | def __init__(self, value): 36 | self._value = value 37 | 38 | def show(self): 39 | print(f"Value is {self._value}") 40 | 41 | @property 42 | def ten_value(self): 43 | return 10* self._value 44 | 45 | @ten_value.setter 46 | def ten_value(self, new_value): 47 | self._value = new_value/10 48 | 49 | obj = MyClass(10) 50 | obj.ten_value = 55 51 | print(obj.ten_value) 52 | obj.show() 53 | -------------------------------------------------------------------------------- /Lessons/SuperKeyword.py: -------------------------------------------------------------------------------- 1 | # super() keyword in python is used to refer to the parent class 2 | 3 | class PrimeMinister: 4 | Nidhi = 500000 5 | def __init__(self,name,party,income): 6 | self.name=name 7 | self.party=party 8 | self.income=income 9 | 10 | def watchPM(self): 11 | print(f"The Prime Minister Name is {self.name} is a {self.party} party member.") 12 | 13 | def salaryCalc(self): 14 | return self.income+ self.Nidhi 15 | 16 | class MaharashtraCM(PrimeMinister): 17 | def __init__(self,name,party,payment,salary): 18 | self.name=name 19 | self.party=party 20 | self.payment=payment 21 | self.salary=salary 22 | super().__init__(name,party,payment) 23 | 24 | def watchPM(self): 25 | print(f"The CM Name is {self.name} is a {self.party} party member.") 26 | 27 | def totalpayment(self): 28 | return self.payment + super().salaryCalc() 29 | 30 | 31 | minister=MaharashtraCM("Eknath Shinde","ShivSena",23000,500000) 32 | minister.watchPM() 33 | print("Total Payment received: ",minister.totalpayment()) 34 | 35 | -------------------------------------------------------------------------------- /Lessons/DictionariesInPython.py: -------------------------------------------------------------------------------- 1 | # Ordered Collection Of Element In Python 2 | # Items are in key value pair 3 | 4 | info={ 5 | "Name":"Shubham", 6 | "Age":"21", 7 | "isDriveCar":"Yes", 8 | "isVoter":True, 9 | } 10 | 11 | print(info) 12 | 13 | print(info["isDriveCar"]) #print particular item if not found throws error 14 | print(info.get("Age")) #print particular item if not found does not throws error 15 | print(info.keys()) #display all keys 16 | print(info.values()) # display all Values 17 | print(info.items()) # display all Key-Value Pairs 18 | 19 | 20 | 21 | ## Dictionary Methods ==> 22 | 23 | #Update() method 24 | info = {'name':'Shubham', 'age':21, 'Drive':True, 'isMarried':False} 25 | print(info) 26 | info.update({'DOB':2002}) 27 | print(info) 28 | 29 | #Remove all items 30 | #using Clear() method 31 | info.clear() 32 | print(info) 33 | 34 | #using pop() method 35 | info.pop('name') 36 | print(info) 37 | 38 | #using popitem()method==> Remove Last Item From Dictionary 39 | info.popitem() 40 | print(info) 41 | 42 | #Delete Dictionary 43 | dic={ 44 | "Shubham":"502", 45 | "Arjun":"434" 46 | } 47 | del dic["Shubham"] #delete particular key pair 48 | print(dic) 49 | del dic #delete all values -------------------------------------------------------------------------------- /Lessons/dundermethods.py: -------------------------------------------------------------------------------- 1 | class Employee: 2 | 3 | #The __init__ method is a special method that is automatically invoked when you create a new instance of a class. 4 | #this method is also called as constructor. 5 | def __init__(self, name): 6 | self.name = name 7 | 8 | 9 | #The __len__ method is used to get the length of an object. 10 | #This is useful when you want to be able to find the size of a data structure, such as a list or dictionary. 11 | def __len__(self): 12 | i = 0 13 | for c in self.name: 14 | i = i + 1 15 | return i 16 | 17 | #The __str__ methods are used to convert an object to a string representation. 18 | #The str method is used when you want to print out an object. 19 | def __str__(self): 20 | return f"The name of the employee is {self.name} str" 21 | 22 | 23 | #The __repr__ methods are used to convert an object to a string representation. 24 | #repr method is used when you want to get a string representation of an object that can be used to recreate the object. 25 | def __repr__(self): 26 | return f"Employee('{self.name}')" 27 | 28 | #The __call__ method is used to make an object callable. 29 | #you can pass it as a parameter to a function and it will be executed. 30 | def __call__(self): 31 | print("Hey I am good") 32 | 33 | 34 | e = Employee("Shubham") 35 | print(str(e)) 36 | print(repr(e)) 37 | print(e.name) 38 | print(len(e)) 39 | e() -------------------------------------------------------------------------------- /Lessons/RegularExpression.py: -------------------------------------------------------------------------------- 1 | # 1) Searching for a pattern in re using re.search() Method ==>> 2 | import re 3 | # Define a regular expression pattern 4 | pattern = r"expression" 5 | # Match the pattern against a string 6 | text = "Hello, world!" 7 | match = re.search(pattern, text) 8 | if match: 9 | print("Match found!") 10 | else: 11 | print("Match not found.") 12 | print("______________________________________") 13 | 14 | 15 | # 2) Searching for a pattern in re using re.findall() Method ==>> 16 | import re 17 | pattern = r"expression" 18 | text = "The cat is in the hat." 19 | matches = re.findall(pattern, text) 20 | print(matches) 21 | print("______________________________________") 22 | 23 | 24 | # 3) The following example shows how to replace a pattern in a string ==>> 25 | import re 26 | pattern = r"[a-z]+at" 27 | text = "The cat is in the hat." 28 | matches = re.findall(pattern, text) 29 | print(matches) 30 | new_text = re.sub(pattern, "dog", text) 31 | print(new_text) 32 | print("______________________________________") 33 | 34 | 35 | 36 | # 4) The following example shows how to extract information from a string using regular expressions: ==>> 37 | import re 38 | text = "The email address is example@example.com." 39 | pattern = r"\w+@\w+\.\w+" 40 | match = re.search(pattern, text) 41 | if match: 42 | email = match.group() 43 | print(email) 44 | print("______________________________________") -------------------------------------------------------------------------------- /Lessons/StringMethods.py: -------------------------------------------------------------------------------- 1 | myString="hey there I am shubham bhoite !!!!!" 2 | 3 | print(myString.upper()) #convert to upper case 4 | print(myString.lower()) #convert to lower case 5 | print(myString.rstrip("!")) #removes the special type of symbols that we specified 6 | 7 | print(myString.replace("shubham","varad")) #replace the string 8 | 9 | print(myString.split(" ")) #split according to argument and make list 10 | 11 | print(myString.capitalize()) #capitalize first letter 12 | 13 | print(myString.title()) #capitalize first letter of all words 14 | 15 | print(myString.swapcase()) #Swap the Cases 16 | 17 | print(myString.find("s")) 18 | 19 | print(myString.index("b")) 20 | 21 | print(myString.isspace()) #check all string is of white spaces or not 22 | 23 | 24 | str1 = "Welcome to the Console !!!" 25 | print(str1.endswith("!!!")) 26 | 27 | str1 = "Welcome to the Console !!!" 28 | print(str1.endswith("to", 4, 10)) 29 | 30 | str1 = "He's name is Dan. He is an honest man." 31 | print(str1.find("ishh")) 32 | 33 | 34 | str1 = "WelcomeToTheConsole" 35 | print(str1.isalnum()) 36 | str1 = "Welcome" 37 | print(str1.isalpha()) 38 | 39 | str1 = "hello world" 40 | print(str1.islower()) 41 | 42 | str1 = "We wish you a Very Happy Birthday" 43 | print(str1.isprintable()) 44 | str1 = " " #using Spacebar 45 | print(str1.isspace()) 46 | str2 = " " #using Tab 47 | print(str2.isspace()) 48 | 49 | str1 = "World Vision India" 50 | print(str1.istitle()) 51 | 52 | str1 = "Python is a high level programming Language" 53 | print(str1.startswith("Python")) 54 | 55 | str1 = "Python is a High level Programming Language" 56 | print(str1.swapcase()) 57 | 58 | str1 = "His name is Rahul. Rahul is an honest man." 59 | print(str1.title()) -------------------------------------------------------------------------------- /Lessons/SetMethods.py: -------------------------------------------------------------------------------- 1 | # Operations On Sets 2 | states1={"Maharashtra","Goa","Gujrat","Kerala","Bihar"} 3 | states2={"Tamilnadu","Delhi","Punjab","Jammu","Goa","Kerala"} 4 | 5 | #Union 6 | print("Union Set: ",states1.union(states2)) #print values of both set excepting Duplicate values 7 | 8 | # Intersection 9 | print("Intersection Set: ",states1.intersection(states2)) # Print Common Values 10 | 11 | # Symmetric Difference 12 | print("Symmetric Difference: ",states1.symmetric_difference(states2)) # not similar in both sets 13 | 14 | # Difference 15 | print("Difference: ",states1.difference(states2)) 16 | 17 | 18 | # Methods In Sets 19 | 20 | # isdisjoint() 21 | print("Is Disjoint: ",states1.isdisjoint(states2)) 22 | 23 | # issuperset() 24 | print("Is Super Set: ",states1.issuperset(states2)) 25 | 26 | # issubset() 27 | print("Is Sub Set: ",states1.issubset(states2)) 28 | 29 | # Add Single item to set 30 | states1.add("Tripura") 31 | print("Added Single Element: ",states1) 32 | 33 | # Add More Then One item 34 | newSet={"Assam","Karnataka"} 35 | states2.update(newSet) 36 | print("Added Multiple Element: ",states2) 37 | 38 | # Remove From Set with remove() 39 | states2.remove("Goa") 40 | print("Removed Single Element: ",states2) #If Item Not found It will throw error 41 | 42 | # Remove From Set with discard() 43 | states2.discard("Jammu") 44 | print("Removed Single Element: ",states2) #If Item Not found It will not throw error 45 | 46 | 47 | # Del keyword to delete set 48 | delemoji={"happy", "sad","angry"} 49 | del delemoji 50 | # print(delSet) # Throws an Error 51 | 52 | #Use To delete all item in sets 53 | clearSet={51,62,73,84,95,41} 54 | clearSet.clear() 55 | print(clearSet) 56 | 57 | #Check if Element is present or Not 58 | if 84 in clearSet: 59 | print("Yes") 60 | else: #This will print No because we cleared Set in previous method(Line 55) 61 | print("No") -------------------------------------------------------------------------------- /Exercises/KBC.py: -------------------------------------------------------------------------------- 1 | questions = [ 2 | [ 3 | "Which language was used to create fb?", "Python", "French", "JavaScript", 4 | "Php", "None", 4 5 | ], 6 | [ 7 | "Ricky Ponting is also known as what?", "The Rickster", "Ponts", "Ponter", 8 | "Punter", "None", 4 9 | ], 10 | [ 11 | "'.MOV' extension refers usually to what kind of file?", "Image file", "Animation/movie file", "Audio file", 12 | "MS Office", "None", 2 13 | ], 14 | [ 15 | "Fastest shorthand writer was?", "Dr. G. D. Bist", "J.R.D. Tata", "J.M. Tagore", 16 | "Khudada Khan", "None", 1 17 | ], 18 | [ 19 | "Entomology is the science that studies?", "Behavior of human beings", "Insects", "The formation of rocks", 20 | "The origin and history of technical term", "None", 2 21 | ], 22 | [ 23 | "The present Lok Sabha is the?", "14th Lok Sabha", "15th Lok Sabha", "16th Lok Sabha", 24 | "17th Lok Sabha", "None", 4 25 | ], 26 | [ 27 | "When is Independence Day in Australia?", "03 March", "03 Feb", "03 April", 28 | "03 May", "None", 1 29 | ], 30 | [ 31 | "The members of the Rajya Sabha are elected by?", "the people", "Lok Sabha", "elected members of the legislative assembly", 32 | "elected members of the legislative council", "None", 3 33 | ] 34 | ] 35 | 36 | levels = [1000, 2000, 3000, 5000, 10000, 20000, 40000, 80000, 160000, 320000] 37 | money = 0 38 | for i in range(0, len(questions)): 39 | 40 | question = questions[i] 41 | print(f"\n\nQuestion for Rs. {levels[i]}") 42 | print(f"a. {question[1]} b. {question[2]} ") 43 | print(f"c. {question[3]} d. {question[4]} ") 44 | reply = int(input("Enter your answer (1-4) or 0 to quit:\n" )) 45 | if (reply == 0): 46 | money = levels[i-1] 47 | break 48 | if(reply == question[-1]): 49 | print(f"Correct answer, you have won Rs. {levels[i]}") 50 | if(i == 4): 51 | money = 10000 52 | elif(i == 9): 53 | money = 320000 54 | elif(i == 14): 55 | money = 10000000 56 | else: 57 | print("Wrong answer!") 58 | break 59 | 60 | print(f"Your take home money is {money}") 61 | -------------------------------------------------------------------------------- /Lessons/FileOperations.py: -------------------------------------------------------------------------------- 1 | f = open('MyFiles/Lectures/file1.txt', 'r') 2 | text=f.read() 3 | print(text) 4 | f.close() 5 | 6 | # File Opening Modes 7 | # 1. read(r): Open File In Read Mode/ Default Mode 8 | # 2. write(w): Open File In Write Mode. In That we can add new content to file but previous file content is erase. 9 | # 3. append(a): Open file in append mode in that new content added at the end without erasing previous content. 10 | # 4. create(x): Create file and give error if file already exists. 11 | # 5. text(t): Used to handle text Files (Default Mode). 12 | # 6. binary(b): Used to open file in binary mode. useful to read jpeg,png,exe, etc.. 13 | 14 | 15 | # Writing into File 16 | f=open('MyFiles/Lectures/file2.txt','w') 17 | f.write("Hello, My name is Shubham!!") 18 | f=open('MyFiles/Lectures/file2.txt','r') 19 | file2data=f.read() 20 | print(file2data) 21 | f.close() 22 | 23 | 24 | # Append Mode 25 | print("Append Mode:: ") 26 | f=open('MyFiles/Lectures/file2.txt','a') 27 | f.write("\nHey brother, How are you? ") 28 | f=open('MyFiles/Lectures/file2.txt','r') 29 | file2data=f.read() 30 | print(file2data) 31 | f.close() 32 | 33 | # Using "with" Statement 34 | print("Using with statement ::") 35 | with open('MyFiles/Lectures/file2.txt','r') as f: 36 | with_data=f.read() 37 | print(with_data) 38 | 39 | 40 | # readline() Method- Use to read file content line by line 41 | 42 | f=open('MyFiles/Lectures/file3.txt','r') 43 | while True: 44 | line=f.readline() 45 | if not line: 46 | break 47 | print(line) 48 | 49 | 50 | # writeline() Method - to write Multiple Lines 51 | 52 | f= open('MyFiles/Lectures/file4.txt','w') 53 | lines=['Line1 \n''Line2 \n''Line3 \n''Line4\n'] 54 | f.writelines(lines) 55 | f.close() 56 | f=open('MyFiles/Lectures/file4.txt','r') 57 | text=f.read() 58 | print(text) 59 | f.close() 60 | 61 | # seek() Function - allows to move the current position within a file to specific point 62 | with open('MyFiles/Lectures/file4.txt','r') as f: 63 | f.seek(10) 64 | data=f.read(5) 65 | print(data) 66 | 67 | 68 | # tell() Function - Returns the current position of seek within the file 69 | f=open('MyFiles/Lectures/file4.txt','r') 70 | f.seek(12) 71 | print(f.tell()) 72 | 73 | # truncate() - We Can truncate the file from starting position 74 | with open('MyFiles/Lectures/file5.txt','w') as f: 75 | f.write("This Is Truncate Method") 76 | f.truncate(10) 77 | 78 | with open('MyFiles/Lectures/file5.txt','r') as f: 79 | filedata=f.read() 80 | print(filedata) 81 | f.close() -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Python From Scratch 2 | 3 | ## Lessons : 4 | 5 | - [First Program](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/FirstProgram.py) 6 | 7 | - [Comments Escape Sequence](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/CommentsEscapeSequence.py) 8 | 9 | - [Variables Data Types](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/VariablesDataTypes.py) 10 | 11 | - [Type Casting](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/TypeCasting.py) 12 | 13 | - [User Input](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/UserInput.py) 14 | 15 | - [String In Python](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/String.py) 16 | 17 | - [String Slicing](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/String-Slicing.py) 18 | 19 | - [String Methods](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/StringMethods.py) 20 | 21 | - [If Else Conditions](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/IfElse.py) 22 | 23 | - [Match Case Statement](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/MatchCases.py) 24 | 25 | - [Loops](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/Loops.py) 26 | 27 | - [Break Continue Statements](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/BreakContinue.py) 28 | 29 | - [Functions](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/Functions.py) 30 | 31 | - [Function Arguments](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/FunctionArguments.py) 32 | 33 | - [Lists](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/ListsInPython.py) 34 | 35 | - [Lists Methods](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/ListsMethods.py) 36 | 37 | - [Tuples](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/TuplesInPython.py) 38 | 39 | - [f-Strings](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/f-Strings.py) 40 | 41 | - [Doc String](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/docStrings.py) 42 | 43 | - [PEP8(The Zen of Python)](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/pep8.py) 44 | 45 | - [Recursion](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/Recursion.py) 46 | 47 | - [Sets](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/Sets.py) 48 | 49 | - [Set Methods](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/SetMethods.py) 50 | 51 | - [Dictionaries](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/DictionariesInPython.py) 52 | 53 | - [Else With Loop](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/ElseWithLoops.py) 54 | 55 | - [Error Handling](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/ErrorHandling.py) 56 | 57 | - [Finally Keyword](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/FinallyKeyword.py) 58 | 59 | - [Custom Error](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/CustomError.py) 60 | 61 | - [Short Hand For If Else](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/ShortIfElse.py) 62 | 63 | - [Enumerate Function](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/EnumerateFunction.py) 64 | 65 | - [Virtual Environment](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/VirtualEnvironment.md) 66 | 67 | - [How import Works?](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/Importing.md) 68 | 69 | - [if __ name __ == "__ main __"](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/If__Name__and__main__.md) 70 | 71 | - [Local and Global Variable](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/LocalGlobal.py) 72 | 73 | - [File Operations](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/FileOperations.py) 74 | 75 | - [Lambda Functions](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/LambdaFunction.py) 76 | 77 | - [is and ==](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/is%20and%20equal.py) 78 | 79 | - [Introduction of oop's](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/IntroOOP'S.md) 80 | 81 | - [Classes and Objects](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/ClassesandObjects.py) 82 | 83 | - [Constructors](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/Constructor.py) 84 | 85 | - [Decorators](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/Decorators.py) 86 | 87 | - [Getters and Setters](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/GettersandSetters.py) 88 | 89 | - [Inheritance](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/Inheritance.py) 90 | 91 | - [Access Modifiers](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/AccessModifiers.py) 92 | 93 | - [Static Methods](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/Staticmethods.py) 94 | 95 | - [Instance and Class Variable](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/InstanceVsClassVariable.py) 96 | 97 | - [Class Methods](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/ClassMethods.py) 98 | 99 | - [Class Methods as a Alternative Constructor](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/ClassMethodAsAlternativeConstructor.py) 100 | 101 | - [dir, __dict__, help methods](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/dir-dict-help-methods.py) 102 | 103 | - [Super Keyword](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/SuperKeyword.py) 104 | 105 | - [Dunder Methods](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/dundermethods.py) 106 | 107 | - [Method Overriding](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/MethodOverriding.py) 108 | 109 | - [Operator Overloading](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/OperatorOverloading.py) 110 | 111 | - [Single Inheritance](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/SingleInheritance.py) 112 | 113 | - [Multiple Inheritance](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/MultipleInheritance.py) 114 | 115 | - [Multi Level Inheritance](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/MultiLevelInheritance.py) 116 | 117 | - [Hybrid Inheritance](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/HybridInheritance.py) 118 | 119 | - [Hierarchical Inheritance](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/HierarchicalInheritance.py) 120 | 121 | - [Time Module](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/TimeModule.py) 122 | 123 | - [Walrus Operator](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/walrusoperator.py) 124 | 125 | - [Shutil Module](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/ShutilModule.py) 126 | 127 | - [Request Module](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/RequestsModule.py) 128 | 129 | - [Generator In Python](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/Generators.py) 130 | 131 | - [Function Caching](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/FunctionCaching.py) 132 | 133 | - [Regular Expression](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/RegularExpression.py) 134 | 135 | - [Multiprocessing In Python](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Lessons/multiprocessing.py) 136 | 137 | 138 | --- 139 | 140 | ## Exercises : 141 | 142 | - [Simple Calc-1](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Exercises/Ex1-SimpleCalculator1.py) 143 | 144 | - [Simple Calc-2](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Exercises/Ex1-SimpleCalculator2.py) 145 | 146 | - [Gives Timing](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Exercises/Ex2-GivesTiming.py) 147 | 148 | - [Kaun Banega Crorepati](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Exercises/KBC.py) 149 | 150 | - [Snake Water Gun](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Exercises/snakegame.py) 151 | 152 | - [Library Class](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Exercises/books.py) 153 | 154 | - [Clutter](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Exercises/clutter.py) 155 | 156 | - [News API](https://github.com/Shubham-Bhoite/Python-Programming/blob/main/Exercises/NewsAPI.py) 157 | --------------------------------------------------------------------------------