Dwarka Coding Club Page

Dwarka Coding Club Page A Dwarka based coding club helping students to learn coding online

04/12/2022

Access Google Drive with a Google account (for personal use) or Google Workspace account (for business use).

21/10/2022

#54 Monkey patching in python || Explained in 1 minute || Dwarka Coding Club Page

This video explains the monkey patching in python

Complete playlist: https://www.youtube.com/watch?v=n_F-_atStj8&list=PLLYZEFeS7wKiSN566R0keHLwucMmyXdqR

=============================== Notes =====================================

Monkey patching: for testing purpose, we modify the functionality of a function and after testing, we can set it back to its original functionality

class Sample:
def func1(self):
print("this is func1 from Sample")

def func2(self):
print("this is func2 from Sample")

def monkey_patch(self):
print("this is a patch for testing")

patch = Sample.func2
Sample.func2 = Sample.monkey_patch # monkey patching done
obj = Sample()
obj.func2()
Sample.func2 = patch # functionality restored
obj.func2()

21/10/2022

#53 Lambda functions in python || Explained in 1 minute || Dwarka Coding Club Page

This video explains the lambda functions in python

Complete playlist: https://www.youtube.com/watch?v=n_F-_atStj8&list=PLLYZEFeS7wKiSN566R0keHLwucMmyXdqR

=============================== Notes =====================================

Lambda functions: they are anonymous functions which can be used if a single line logic

def square(num):
return num*num

print(square(20))

func = lambda x : x*x
print(func(10))

21/10/2022

#52 Generators in python || Explained in 1 minute || Dwarka Coding Club Page

This video explains the generators in python

Complete playlist: https://www.youtube.com/watch?v=n_F-_atStj8&list=PLLYZEFeS7wKiSN566R0keHLwucMmyXdqR

=============================== Notes =====================================

Generators: we can generate the value only when the function is called instead of holding all the value in memory

gen = (i*i for i in range(10))

print(next(gen))
print(next(gen))
print(next(gen))

"yield" keyword can also be used to create a generator

def square(n):
for i in range(n):
yield i*i

gen2 = square(10)
print(next(gen2))
print(next(gen2))
print(next(gen2))

21/10/2022

#51 Decorators in python || Explained in 1 minute || Dwarka Coding Club Page

This video explains the decorators in python

Complete playlist: https://www.youtube.com/watch?v=n_F-_atStj8&list=PLLYZEFeS7wKiSN566R0keHLwucMmyXdqR

=============================== Notes =====================================

Decorator: it can be used to enhance the functionality of a function

def adder(a,b):
print(a+b)

adder(10,20)

def dec(func):
def inner(x,y):
print("before function call")
func(x,y)
print("after function call")
return inner


def adder(a,b):
print(a+b)

adder(10,20)

21/10/2022
21/10/2022
21/10/2022
21/10/2022

#50 Comprehensions in python || Explained in 1 minute || Dwarka Coding Club Page

This video explains the comprehensions in python

Complete playlist: https://www.youtube.com/watch?v=n_F-_atStj8&list=PLLYZEFeS7wKiSN566R0keHLwucMmyXdqR

=============================== Notes =====================================

Comprehensions: it is a shortcut to create a collection based on a certain condition

lst = []
for i in range(10):
if i%2 == 0:
lst.append(i)
print(lst)

print([i for i in range(10) if i%2 == 0])

we can create a collection without any condition as well

print([i for i in range(10)])

comprehensions can also be used to create set and dict

21/10/2022

#49 Operator overloading in python || Explained in 1 minute || Dwarka Coding Club Page

This video explains the operator overloading in python

Complete playlist: https://www.youtube.com/watch?v=n_F-_atStj8&list=PLLYZEFeS7wKiSN566R0keHLwucMmyXdqR

=============================== Notes =====================================

Operator overloading: using a predefined operator with a user defined variable (object)

class Person:
def __init__(self,a):
self.age = a

def __add__(self,obj):
return self.age + obj.age

obj1 = Person(10)
obj2 = Person(20)
print(obj1 + obj2)

Address

Dwarka Sec-7
Dwa
110075

Opening Hours

Monday 3pm - 10pm
Tuesday 3pm - 10pm
Wednesday 3pm - 10pm
Thursday 3pm - 10pm
Friday 3pm - 10pm
Saturday 8am - 10pm
Sunday 8am - 10pm

Alerts

Be the first to know and let us send you an email when Dwarka Coding Club Page posts news and promotions. Your email address will not be used for any other purpose, and you can unsubscribe at any time.

Contact The School

Send a message to Dwarka Coding Club Page:

Shortcuts

Share