Posts

 FLEXBOX <! DOCTYPE html > < html lang = " en " > < head >     < meta charset = " UTF-8 " >     < meta name = " viewport " content = " width=device-width, initial-scale=1.0 " >     < meta http-equiv = " X-UA-Compatible " content = " ie=edge " >     < title > Flexbox Tutorial </ title >     < style >         . container {             height : 544 px ;             width : 100 % ;             border : 2 px solid black ;             display : flex ; /* Initialize the container as a flex box */                         /* Flex properties for a flex container */             /* flex-direction: row; (Default value of flex-direction is row) */             /* flex-direction: column;             flex-direction: row-reverse;             flex-direction: column-reverse; */                         /* flex-wrap: wrap; (Default value of flex-direction is no-wrap) */            
 RESPONSIVE rem,em vw and vh <! DOCTYPE html > < html lang = " en " > < head >     < meta charset = " UTF-8 " >     < meta name = " viewport " content = " width=device-width, initial-scale=1.0 " >     < meta http-equiv = " X-UA-Compatible " content = " ie=edge " >     < title > Size units </ title >     < style >         html {             font-size : 25 px ;         }         . container {             width : 400 px ;             /* height: 344px; */             height : 100 vh ;             width : 100 vw ;             font-size : 10 px ;             border : 2 px solid red ;         }     h1 {         text-align : center ;     }     # first {         /* font-size: 3em;         padding: 3em; */     }     # second {         /* font-size: 3rem;         padding: 3rem; */     }         </ style > </ head > < body >     < div class = "
 DEL VARIABLE my_variable1 = 20 my_variable2 = "GeeksForGeeks" # check if my_variable1 and my_variable2 exists print(my_variable1) print(my_variable2) # delete both the variables del my_variable1 del my_variable2 # check if my_variable1 and my_variable2 exists print(my_variable1) print(my_variable2)
EXCEPTION HANDLING a = 4 b = 0 try : k = a//b print (k) except ZeroDivisionError : print ( "Can't by zero" ) finally : print ( 'This is always executed' ) print ( "The value of a / b is : " ) assert b != 0 , "Divide by 0 error" print (a / b)
 class and object class Person: def __init__ ( self , name , age): self .name = name self .age = age def myfunc ( self ): print ( "Hello my name is " + self .name) p1 = Person( "John" , 36 ) p1.myfunc()
 LARGEST NUMBER IN A LIST list = [ 22 , 44 , 56 , 77 , 89 , 43 , 740 ] list.sort() print ( "the smallest number in a list is:" , list[ 0 ])
 clear utkarsh = [ 1 , 2 , 3 , 4 ] print ( 'utkarsh before clearing:' , utkarsh ) utkarsh . clear () print ( 'utkarsh after clearing:' , utkarsh )