List concepts in python with examples part 1

By // No comments:
What is List
  • A List can store the sequence of various types of data.
  • A list is a container data type.Container is a an entity which contains multiple data items.It is also known as a collection.
  • There are some container data types in python.
  1. List
  2. Tuple
  3. Set
  4. Dictionary
  • Container data type are also known as compound data types.
  • Lists are mutable in python.It means we can change the list element after it created.
  • A list can be collection of Items with different data types(int,string,float etc.).
  • A list can contain similar and dissimilar both data types.
  • The items in the list are separated with comma(,) and enclosed with the square brackets [].
3

How to use break,continue and pass statements in python with examples

By // No comments:
There are three most important statements are used in python program as given below:
  1. break statement
  2. continue statement
  3. pass statement
1.) The break statement:-
  • The break is a keyword in python.It is used to terminate the loop when we use break statement in any python programs.
  • The break statement is used to abort(terminate) the current execution of the loop and the control goes to the next line after the loop.
3

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
Powered by Blogger.