OOPs in Python October 19, 2022 # OOP ----> Object Oreiented Programming # makes program easier to manage and help in real world programming # class # object(instance)...Read More
Generators in Python October 18, 2022l = [ 1 , 2 , 3 , 4 , 5 ] # list ----> whole list will get added to memory(occupies more space) # generator ----> (1) ---replace---&g...Read More
Decorators in Python October 17, 2022# enhances the functionality of other functions --> Decorators from functools import wraps def deco ( func ): @ wraps ( func ) ...Read More
Closures in python October 16, 2022# def sq(a): # return a ** 2 # b = sq # print(b()) def first_func (): def sec_func (): print ( "This is sec func....&...Read More
Iterator vs Iterable October 15, 2022 Iterator vs Iterable l = [ 1 , 2 , 3 , 4 , 5 ] # iterable print ( l ) x = map ( lambda a : a ** 2 , l ) # iterator print ( x ) # for ...Read More
Advanced Functions October 14, 2022 Advanced Functions # enumerate() # l =["hi","hello","world"] # x = 0 # for i in l: # print(f"{x} = {...Read More
Lambda Function October 13, 2022 Lambda Function # lambda function ---> Anonymous function # def add(a,b): # return a+b # print(add(2,3)) # a = lambda a,b: a + b # p...Read More
Using all types parameters in one function October 12, 2022 Using all types parameters in one function # normal parameters # default parameters # args ---> arguments # kwargs ---> keyword argum...Read More
**kwargs October 11, 2022**kwargs # **kwargs def abc (** kwargs ): # Parametre return kwargs d = { "a" : 2 , "b" : 4 , "c" : 6...Read More
*args October 10, 2022*args # def add(a,b): # return a+b # print(add(2,3,4,5)) def add (* args ): #----> Parametres # * makes a tuple of arguments x =...Read More
Set Comprehension October 09, 2022 Set Comprehension s = { i ** 3 for i in range ( 1 , 11 )} print ( s ) l = [[ 1 , 2 , 3 ],[ 4 , 5 , 6 ],[ 7 , 8 , 9 ]] s1 = { i for ...Read More
Dictionary Comprehension-2 October 08, 2022 Dictionary Comprehension d = {} for i in range ( 1 , 11 ): if i % 2 == 0 : d [ i ] = "Even" else : ...Read More
Dictionary Comprehension October 07, 2022 Dictionary Comprehension d = { 1 : 1 , 2 : 8 , 3 : 27 } d1 = {} for i in range ( 1 , 11 ): d1 [ i ] = i ** 3 print ( d1 ) d2 = {...Read More
List Comprehension October 06, 2022List Comprehension # l = [] # for i in range(1,11): # l.append(i**3) # print(l) # x = [i**3 for i in range(1,11)] # print(x) # n = [&quo...Read More
Sets October 05, 2022Sets # set --> unordered collection of unique data s = { 1 , 2 , 3 , 4 , 5 , 1.1 , "1" } print ( s ) l = [ 2 , 1 , 3 , 4 , 5 ...Read More
Question/Solution - 8 October 04, 2022Question # {1:2,2:4,3:6,4:8,5:10,6:12,7:14,8:16,9:18,10:20} --- > 2 # input from user----> number # key ----> range(1,10) ...Read More
Dictionary methods October 02, 2022 Dictionary Methods d = { "name" : "Adrika" , "age" : 14 , "class" : 9 } # fromkeys my_dict = di...Read More
Adding and Deleting Data (Dictionaries) October 01, 2022 Adding and Deleting Data (Dictionaries) d = { "name" : "Adrika" , "age" : 14 , "class" : 9 } # a...Read More
in keyword and looping on dictionaries August 22, 2022 in Keyword and looping on Dictionaries d = { "name" : "Adrika" , "age" : 14 , "class"...Read More
Dictionaries in Python August 20, 2022 Dictionaries in Python d = { "name" : "Adrika" , "age" : 14 , "class" : 9 , &...Read More
Tuples July 18, 2022Tuples days = ( "monday" , "tuesday" , "wednesday" , "thursday" , "friday" , &...Read More