Posts

CSS animation.

CSS animation An animation is an element which changes its one style gradually to another style. You can change CSS property according to requirement. To use CSS animation, you must first specify some keyframes for the animation. The animation will gradually change from the style to the new style at certain times to get an animation you must bind the animation to an element. CSS animation properties: @keyframes animation-name animation-duration animation-delay animation-iteration-count animation-direction animation-timing-function animation-fill-mode animation <!DOCTYPE html> <html>     <head>         <style>             div             {                 width: 150px;   ...

Lambda function or anonymous function

Image
Lambda function or anonymous function What is lambda  function? Lambda function is a function they are not declared as other function using def keyword.Rather they are created using lambda keyword. Syntax: lambda argument:Expression Example: sum = lambda   x , y  :x+y print ( sum ( 7 , 5 )) #in the above code lambda function return the value of sum. #in lambda function x,y:x+y (x,y is agreement and x+y is expression that  #get evaluate and return) #it return function object which assign to the identifier sum. lambda function have no name. lambda function can take any number of argument. They are one line argument and hence can not contain multiple line. lambda function can not even access global variable. lambda function with ordinary function def   incr...

What is function?What is function in python?

Image
Function in python What is function? What is function in python? Function is the most important tool in procedural programming language.A function can be defined as it is a block of statement which is used to perform any particular operation according to requirement.A function is a  block of organized and reusable program and code that perform a specific and as well as definite task.The main objective to create a function is to reduce the complexity of a program, in this case a program can be divided in to multiple parts according to requirement that part is called function or module. We can create user friendly program with the help of function in this case user can create separate function for each module  module according to requirement. It provide extensibility , it means program can be enhanced module wise in feature. it also provide reusable of program, it means a function can coll more than one times There are two types of function one predefined fu...

python pattern programming

Image
PYTHON PATTERN PROGRAMMING Python nested loop: Python allow programmer to use nested loops.Nested loop means when one loop is define into another loop is known as nested loop,in which one is called inner loop and another is called outer loop.In which when outer loop's condition is true than inner loop will be execute. we use the concept of nested loop in pattern programming etc. syntax: while (condition):      while (condition):         statement x     statement y   Some examples of nested loop. Nested loop program. Q. write  a program to print following pattern. P P Y P Y T P Y T H P Y T H O P Y T H O N str = "PYTHON" for  i  in   range ( 0 , 6 ):      print ()      for  j  in   range ( 0 ,i+ 1 ):      ...

Looping statement in python

Image
Basic looping structure in python Python supports basic loop structures through iterative statements.iterative statements are decision control statements that are used to repeat the execution of a list of statements.python language supports two types of iterative statements - while loop and for loop. While loop: The while loop provides a mechanism to repeat one or more statements while a particular  condition is true. Syntax: statement x while  (condition):     block of statement statement y  A while loop is also referred to as a top-checking loop since control condition is places as the first line of the code. if the condition evaluates to false, then the statement enclosed in the loop are never executed ... now look following examples: Q. write a program in python to calculate the sum and average of first 10 number. i =  0 s =  0 while (i<= 10 ):  ...

Decision making statement in python

Image
Decision making statement in python In this statement we can take a decision for executing block of statement.if in this case condition is checked.if condition is true then the true part will execute,otherwise false part will execute.        There are four types of decision making statement. (1) simple if statement/single alternative if statement. (2) if-else statement/double alternative if statement. (3) if-else-if statement/else if ladder statement. (4) Nested if statement/compound if statement. (1)simple if statement/single alternative if statement  In this statement if condition is true then true part will execute otherwise no action will generate.  Syntax: if  test expression:     Statement 1     Statement 2     Statement 3    ---------------    ---------------     Statement n Statement x Examples: if  ( age>=18) :    print( "You are elig...