Comments in python

           What is comment :

When are you writing programming  code,  sometimes have to tell about some statements and functions, then you can tell that statement and function as a comment . 
What is its work and how to do it
 you can give comments in many ways.  As described below.

Types of comment :-

There are basically two types of python comment -

1.  Single line comment 
2.  Multiple line comment 

1.  Single line comment :-


When you write programming code, you sometimes have to comment a single line, so you use # sign in the starting for this.

Example : 
 # this is single line comment 

2.  Multiple line comment :-


When you write codes in python program, sometimes you have to comment two or more lines, for this you use triple times (" ") sign in the both of side begging and ending .

Example: 
""" this is 
    Multiple line comment """

Module of python/ windows power shell

Module :

Module is a predefined code that is used in python code to import modules and you can do your work continue. Use of modules you write code easy and best operations performed. Because in the modules write code best form already. Such as, if you want to any mathematical operation performed in your python program then you have not need to write a large code, you can just import math module and your work is done.
 There is a lot of work you can do from modules , for this you do not need to write anything long write code. 

Types of module:-

Modules are two types 
1. External module- calculate, math etc
2. Built-in module -flask, pandas etc

How to install modules :

1.  Open your cmd prompt or windows power shell .

2.  Type command : pip install module name (flask,pandas etc)  and press enter key. 

 3.  And then finally installed and download module.

Syntax:  import pandas:

Power shell :-

   power shell is developed by Microsoft that helps task automation. Configuration management. In the power shell both of important command line shell and scripting language. Windows power shell is a task based on command line, automation platform and scripting language And it is interactive objective oriented command environment language. That use to easy of task system administrator and windows server system management. It is created in the dot net framework so it is control only windows environment. 



Python installation/python environment

Python Installation and Environment 

Installation of python :-   

Python installation  steps are on windows machine in given below -

1. Open your web browser and go to this website https://www.python.org.download.



2. Show on all version of python you choose a link of version who's install on your computer system .

3. And then click on the download.



4.  Your python MIS file where is a downloaded version of python. You are going to install.


5.  To use this installer python MIS file the windows system support Microsoft installer 2.0 just have the installed file to your load machine and then run it to find out if your machine support MIS. Run the download file by double clicking in its windows explorer this brings up the python install wizard, which is ready easy to use. 
Just accept the default settings, wait until the installation finished and you are ready to roll.

Python environment :-

When we start writing any type of programming language, I first need to understand them. So use start writing our python program let's understand how to set up your python environment. Python is available on a wide variety of platform including Linux, mac os windows etc.
They operating a traditional windows and type python to find out it already installed and which version you have if it is installed.


Interpreter of python language

Python Interpreter :-   
                                                        Python  interpreter is a Program that reads on execute codes. This include source code, precompiled code and script comment. Python interpreter include perl python and Ruby interpreter, which execute perl python and Ruby code respectively. This means that it is proceed processed at runtime by interpreter and you do not need to compile your program before executing it. This is similar to Ruby and Perl language. Python is a interpreter language so python code run a statement at a time. 

Interpreter environment :



Overview of python programming/Element of python

               Overview of programming :

* What is python :-  python is an interpreted,Object oriented high level programming language with dynamic symantics. It is high level built in data structure combine with dynamic  typing and dynamic building make it every alternative for rappid application

development.

* structure of python program :-

programming structure in python, in general python program consist of so many text files.Which contents python statements . Program is designed as single man, high file with one or more  sepliment files . Such as python online course . In python high level file has important path of control of your program file . You can start your program. The library tools are also known as module files.

* Elements of python :

There are several types of elements in python programming that are shown as -

1. Source code
2. Data types
3. List and Indends
4. Concept of object
5. Oops concept

1. Source code -:-  

In computing source code is only collection of code.  Whose code written using the human readable programming language that is called source code. The source code of a program is specially designed to failitate the work of computer program. Who specify the actions to be performed by computer mostly writing the source code . The source is often transformed by an assembler and compiler into binary machine to understood by the computer .


2. Data types -:-  

variables can store values of different data types . Python is a dynamically programming language hence we need not define the types of variable while declare it.  In python programming language python interpreter is automatically understand data types and store values in the variables.


Example :

 Output :


3. List and Indends -:-


List:-  List is a type of container in the data structure which is used to store multiple value at the same time. In the list we can separate value with the comma. And declare in the square bracket. List is also store values different types at the same time such as number value and string value etc.
Example :


Output :


Indends :-  

Almost every programming language uses the curly brasses {} to define the code of block but in the python program support indentation. That means when we define a function, class or any condition statement ect than it's starting with indentation. A indentation is a blank space.
Example :
Output :


4. Concept of object :-  

 python is an object oriented programming language A object is a same work like variables but variable store only one value at a time, and object is store multiple values at the same time. And objects created  using the class name. A class has one or more objects with different name of object .

Example :
5.oops concept :- 

oops is full name object oriented programming system . In python programming language oops concept have several types that are shown as -

1. Class
2. Object
3. Inheritance
4. Polymorphism
5. Abstraction
6. Encapsulation
7. Message passing

1. Class :-  class is a user  define data type which holds it's own data member and member function.  Which can be accessed and used by reading an instance of that class. A class is like a blue print of an object. And class is defined using with class keyword.
Syntax :-     class  classname :

2. Object:-  An object is a instance of an class and create a memory for store values of variable.  When we define a class then class has no memory is allocated.
Syntax :-   objectname= classname ()

3. Inheritance :- inheritance is a most important concept in the object oriented programming. When we can be describe as a process of creating new classes from existing class. And class inherits some of the property and behavior of the existing class. An  existing class is denote parent class and new class is denote base class .

Types of inheritance :-  there are three types of inheritance :

1. Single inheritance
2. Multiple inheritance
3. Multi level inheritance

1. Single inheritance :-

In single inheritance has only one base class or one derived class and one class inherits properties of only one class.
Example : 

Class myclass:
           Fname="  "
           Lname="  "
              def show(self):
                     Print(self.Fname)
     Class myclass1(myclass):
               def display(self):
                    Print(self.Lname)
              Obj=myclass1()
           Obj. Fname="kamini"
           Obj. Lname="Rahul"
         Obj. Show()
        Obj. Display()

2. Multiple inheritance :-   

multiple inheritance represent a kind of inheritance when a derived class inherits properties of multiple classes.
Example : 

Class A:
           def show(self):
                Print("class A")
 Class B:
           def ShowB (self) :
                 Print("class B")
Class C(A ,B) :
          def showC(self):
               Print("class C")
Obj= C()
Obj.show()
Obj.ShowB()
Obj.ShowC()


3. Multi level inheritance :-

multi level inheritance represent a type of inheritance when a derived class is a base class for another  class.
Example :   

Class A:
           def show(self):
                Print("class A")
 Class B(A):
           def ShowB (self) :
                 Print("class B")
Class C(B ):
          def showC(self):
               Print("class C")
Obj= C()
Obj.show()
Obj.ShowB()
Obj.ShowC()

4. Polymorphism:- 

In the polymorphism we can define one or more function from the same name but every function  has taken different type argument. If you want to take the same name in your program then you use the polymorphism concept.
Example : 
  class A:
             def show(self):
                  Print("it is class A")
Class B:
            def show(self):
                  Print("it is class B")
Obj=A()
Obj1=B()
Obj. Show()
Obj. Show()

5.  Abstraction:-   An abstraction is one of the most essential and important feature of the oops in python programming. Abstraction means display only essential information about the outside world hiding the background details or implementation.

6.  Encapsulation :-   

An encapsulation is a process of combining data member and function in a single unit called class.  This is to prevent the access to the data directly.  The access to them is provided through the functions of the class.

7.  Message passing :-  message passing is a type of communication between process. Message passing is a form of communication used used in parallel programming and oops.  Communications  are completed by the sending of messages to recipients.
        

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...