How to use for loop repetition control in python with examples

By // No comments:
For loop is used to iterate over elements of a sequence such as string,tuple,list and dictionary etc.
For loops are used for sequential traversal. 
For loop has two forms:-
1.)  for var in list:
         statement 1
         statement 2
         statement 3
3

How to use while loop repetition control in python with examples

By // No comments:
There are two types of repetition control instructions in python.
  1. while loop
  2. for loop
1.) while Loop:
  • A while loop allows a part of code to be executed as long as the given condition is true.
  • The while loop is used to repeatedly execute instructions as long as expression is true.
  • A while loop is used in the case where the number of iterations is not know in advance.
3

How to use if-else, elif decision control instruction in python with examples

By // No comments:
There are two ways to control the program flow as given below:-
  1. Decision control instruction (e.g. if ,if-else,elif)
  2. Repetition control instruction (e.g. while,for)
Indentation in Python:-
  • Indentation is used to declare a block in python.If two statements are at the same indentation level,then they are the part of the same block.
  • Python doesn't allow the use of parentheses for the block of codes.
  • All the statements of one block are intended at the same level indentation.
  • In this,we will see how the actual indentation takes place in decision control instructions and others in python.
Decision control instruction:-
There are three ways for taking decisions in a program as given below.
  1. if condition
  2. if-else condition
  3. elif condition
3

What is Asymptotic Notations and how to design and analysis of algorithms with examples

By // No comments:
There are many solutions for a particular problem.Means, For one problem we can design more than one algorithms.But how to find which algorithms are good and which are bad.

There are two ways to find the Ideal Algorithms for any particular problem as given  below:-
  1. Time:-An algorithm is good which takes less time.
  2. Space:-An algorithm is good which takes less space(storage).
The efficiency of any algorithms fully dependent on time,space and other resources which are needed to execute any algorithms. 
Asymptotic Notations:-
Asymptotic notations are the mathematical notations.It is used to represent the complexity of algorithms.This allows us to analyze an algorithm's running time and its behaviors. There are mainly three asymptotic notations to find the complexity of algorithms as given below:-
3

What is Flow chart and how to use different symbols with examples

By // No comments:
Flow chart:-Flow chart is a graphical representation of algorithms to solve the step by step problems in sequential manner.It uses different kinds of Boxes and arrows to represent the process.
There are following symbols are used in flow chart as given below:-
3

What is Algorithms and its Characteristics with examples

By // 1 comment:
Algorithm:-
  • An algorithm is a finite lists of instructions in sequence to solve the computation problems.
  • An algorithm is a step by step of finite number of process to solve the problems.You can write the algorithms in any language which is understandable to the persons (programmers)
  • In Real life,an algorithm is a recipe for any cooking dish.
Characteristics of Algorithms:-
There are following characteristics of any algorithms as given below.
3

string concepts in python part 5

By // No comments:
There are some operational functions for the strings as given below:-
1.) split() :-The split() function is used to split(breaks up) at a specified separator and returns a list of strings. 
Syntax
string.split(separator,maxsplit)
The split function takes maximum two parameters as given below:-
  • Separator:-This is an optional parameter.If separator is specified ,the string split at this specified separator.If separator is not specified ,the string is split at white space (space,newline,coma etc.) separator.
  • maxsplit:-This is also an optional parameter.The maxsplit is used to define maximum number of splits. The default value of max split is -1 ,means no limit of number of splits.
3
Powered by Blogger.