Rangoli using Python October 23, 2022from turtle import * import turtle turtle . setup ( width = 1.0 , height = 1.0 ) turtle . hideturtle () speed ( 100 ) bgcolor ( "bl...Read More
Python Inheritance October 23, 2022 # Inheritance # Multi-level inheritance # Multiple inheritance class Person : # Grandparent class ---> Multi-level inheritance ...Read More
Encapsulation and Abstraction in Python October 22, 2022# Encapsulation ---> Bundling data and methods # Abstraction ---> Hiding the complexity from user class Person : instances = 0 ...Read More
Class Methods in OOPs In Python October 21, 2022 class Person : instances = 0 def __init__ ( self , first_name , last_name ): self . first_name = first_name se...Read More
Diya October 20, 2022DIYA import turtle turtle . up () turtle . color ( "brown" ) turtle . fillcolor ( "brown" ) turtle . setpos (- 200 , 15...Read More
Class Variables in OOPs in Python October 20, 2022 class Student : age = 10 def __init__ ( self , first_name , last_name ): self . first_name = first_name self ....Read More
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---...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