Techniques of problem solving in python

Techniques of problem solving:


When a problem occurs on your computer that describes any issues. A technique problem is a combination of techniques .
It is provide logic for solved any problem.
In the technique problem solving we can solve any problem from multiple ways that are describing in the details given following :

1. Flow charting
2. Decision table
3. Algorithms
4. Structured programming concept
5. Programming methodology
6. Top down and bottom up programming

1. Flow charting:-


A flow chart is a graphical representation of an algorithm. Flow chart uses boxes of different shapes to denote different types of instructions. Mostly programmers use the flowchart for program planning tool for visually organizing a sequence of steps necessary to solve a problem using a computer. The process of drawing a flowchart for an algorithm is known as flowcharting.

Symbols :-  symbols that are used to most commonly to draw a flowchart that are following :


Terminal :-  The terminal symbol is used for the  start and stop of the program. If the program logic has a pause, that is also indicated with a terminal symbol.
Example : 



Input/output:-  All program instructions to input and output data from any type of I/O devices are indicated with i/o symbol in the flowchart. And it is used also reading input data and display the output data.
Example :

Processing :-  this symbol is used for arithmetic calculations and data movement instructions.
Example : 


Decision :-  this symbol indicates a point, that is a point at which a branch more than one alternative point is possible.
Example :


Flowlines :-  this is used for control flow based on direction . It goes into box or comes from the box.
Example :
                   <-  ->

2. Dicision table:-  

A decision table is a good way to deal with different combination of input which produce different result . It is also called cross effect table . Dicision table can be used in test design . They help tester to explore the effect of combination of different inputs. A decision table is basically outstanding technique used in both testing and requirement management.

It help to reduce test effort in verifying each and every combination of test data and ensure complete cover age .

Example :


3. Algorithm :-

A problem is a step by step method of problem solving . It is commonly used for data processing  , calculations and other  related computer and mathematical operation . An algorithm is also used to manipulate data in various ways such as
interesting a new date item searching a particular item or sorting on item.  It is a non technical approach we use algorithm in every day task.

Example :

Step 1 :  start
Step 2 :  read a,  b, c
Step 3 : input a, b
Step 4 : c=a*b
Step 5 : print "c"
Step 6 : stop


4. Structured programming concept :- 

structured programming approach as the word suggest can be design as a programming approach in which the program is made as a single structured. It means that the code will be execute instructions by instructions one after the other. It does not support possible of jumping from one instructions to same other with help of any statement like goto statement. Therefore the instructions

In  this approach will be executed in a serial  and structure manner. The language that support structured programming approach are : c, c++, Java , j#,c# ,python,  etc.

Example :

5. Programming methodology:-  

when programs are developed to solve real life problems like inventory management payroll processing etc. The programming methodology the approach analyzing such complex problem by planning software development process and controlling development process . We will cover the top down approaches to programming is also called modular programming.


Types of programming methodology :


  • Procedural programming
  • Object oriented programming
  • Functional programming
  • Logical programming
  • Top down and modular approach
  • Bottom up approaches


6. Top down and bottom up programming :-


 Top down :   top down programming factor focus on the used of methods . It is also known as modular programming. The program is broken into small modules so that it is easy  trase to particular segment of code in the software program. The modules at the top level are those that program general task and procede to another modules to program a particular task . Each module is based on functionality of its functional and procedures. In this approach the programming begin from top level of herarichy process  words the lower level.  The top down programming uses sequence and nested level of command.
Bottom up :  button up programming to referred the style of the programming where an application is a constructord with the describe of modules . The button up programming is just opposite of top down programming. 

Types of error

Types of error in python :


An error is the technique of successful trapping expect and unexpected error. And error is a tern use to describe any issues .your program encounter software error and hardware error.

There are 5 types of errors that coming up in your computer program :-


1. Syntax error 
2. Logical error 
3. Compile time error 
4. Run time error 
5. Symantec error 

1. Syntax error:-

                                    Syntax error occurs due to the fact that the syntax of the language is not respected. 


2. Logical error :-

                                     Logical error occurs due to the fact that the specification is not respected from the point of view when errors are detected. 


3. Compile time error :                                                                  Compile time error occured when your program have syntax error and Symantec error .



4. Run time error :-

                                          Dynamic Symantec error and logical error that can not be detected by the compiler is called run time error. 


5. Symantec error :-

                                         Symantec error is due to the an improper use of program statement. 
   

Concept of problem solving

* Concept of problem solving :


When we work on computer, we face some problem and we program to overcome solve this problem . In another word problem solving is a determination of basic and sequential steps necessary to arrived at the result of the given problem . For to arrived a final solution we can breaken down into some small part our program which can be solved step by step this problem. 


Most of important steps that solving a problem:-


1. Understanding the problem 
2. Construction list of variable 
3. Output design 
4. program development
5. Testing the program 
6. Validation the program 

Planning of the computer program


  • Planning the computer program:



Computer program is a collection of instructions that perform a specific task.
When we do some work on the computer, we have to give interactions for our task on the computer system and to understand these instructions we have to do planning the computer program. A computer program made from library and related data are referred to as software . Computer program may be categorized along functional line ,such as application software and systems software. In the computer program  we do some calculations and manipulation is known as algorithms. In a programming language from the program in its human readable from of source code a compiler or assembler can drag machine code a from Consisting of instructions that a computer can directly execute alternatively. A computer program may be executed with the aid of interpreter. So computer program  planning is most important for human to understand .

Python introduction/apllication of python with example

Introduction of python

Python is a dynamic,interpreted ,general purpose and high level programming language that was developed by guido van rossum and it was released in 1991. In python programming language we can easily developed website and web applications ,game etc. It support object oriented programming approach to develop 
applications ,python is a very simple and easy to learn , python is also providing lot of high level data structure. It is available on a wide variety of platform including Linux, mac-os and windows etc. Python is an interpreter language that means execute codes line by line you do not need compile your program before executing .  python programming language is similar to Ruby and Perl language. 
"python is an ideal language for scripting and rapid applications development . python support multiprogramming pattern including in object oriented" 

Applications of python :


(1)Web applications 
(2)Web scripting 
(3)Game development 
(4)Robotic 
(5)Data science 

Example :



Output:


Comments in python

            What is comment : When are you writing programming  code,  sometimes have to tell about some statements and functions, then y...