Posts

Recursive function

Image
What  is recursive function ? A recursive function is the function that calls itself during execution of program. Every recursive solution has two major cases, which are fallows: Base case , in which the problem is simple enough to solve directly without making any further calls to the same function. Recursive case , in which first the problem at hand divided into simpler sub-part. Second, the function calls itself but sub-parts of the problem obtained in the first stem. Third, the result is obtained by combining the solutions of simpler sub- part. Thus we see that recursion utilized divide and conquer technique of problem solving.  Divide and conquer technique is a method of solving a given problem by dividing it into two or more smaller instances. Now for understand the recursive function let us see an example of calculating factorial of a number. The factorial of a number id n!= n x (n-1)! Now , 5!= 5 x 4 x 3 x 2 x1     =120 This can be written as: 5!= 5 x  4! 4!= 4 x 3! 3!= 3 X 2

What is Python ?

Image
 Python Python is a popular programming language, it was developed by  Guido van Rossum    at the “national research institute for mathematics and  computer science in Netherland(1991).  It is used for web development(server side), software development, system scripting, machine learning, data science etc. It works on different platform ( window, mac, Linux etc.). It is a high level programming language. It support procedure programming and object oriented programming. It is interpreter based language. Python processed at run time by interpreter so there is no need to compile a program before executing it. You  can simply run the program. Python basically converts the source code into byte code which than translated in native language of computer so that it can be executed. Byte code makes the python code portable. It has simple syntax similar to English language. It has syntax that allow developer to write programmes with fewer lines than some other programming language. It is secure

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;                 height: 150px;                 animation-name:developeranke;                 animation-duration: 3s;                 background-color: aqua;                 border-radius: 10px;                             }

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   increment ( y ):       return ( lambda   x :x+ 1 )(y) # in ordinary function return lambda function. #in lambda function x is argument,x+1 is expression #and y is assign argument/passing

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 function like-di

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 ):          print (str[j],  end = ' ' ) Q. write  a program to print following pattern. *  * *  * * *  * * * *  * * * * * for  i  in   range ( 1 , 6 ):          print ()          for