SlideShare a Scribd company logo
1 of 79
PPS Unit No 1
PPS Unit No 1
• 1
What is computer
What is a Computer
• It is electronic machine.
• Data is collection of raw facts or figure
• Information
• Knowledge
• Instructions
• Program
• Software
• Hardware
Data
Processed
Information
Collected and Applied
Knowledge
History of Computer
• First Generation(1942-1955)
• Second Generation(1955-1964)
• Third Generation(1964-1975)
• Fourth Generation(1975-1989)
Performs computations and makes logical decisions
Millions / billions times faster than human beings
Computer programs
Sets of instructions for which computer processes data
 Hardware.
Physical devices of computer system.
 Software.
Programs that run on computers .
What is Computer Science ?
• It will help you understand that the goal of a
computer scientist is to solve problems using
computers.
• You will see how problems are formulated by
means of algorithms and how the process of
abstraction can be used to break problems
down to easily manageable pieces.
•
18 Jan 2020 9
What is Computer Science ?
 Computers are used just about everywhere in our
society:
 Communications: internet, e-mail, cell phones
 Word Processing: typing/printing documents
 Business Applications: Accounting, spreadsheets
 Entertainment: Games, Multimedia Applications
 Database Management: Police Records, Stock Market
 Engineering Applications: Scientific Analysis,
simulations
 Manufacturing: CAD/CAM, Robotics, Assembly
18 Jan 2020 10
• A computer is a programmable machine that
receives input, stores and manipulates data,
and provides output in a useful format.
Software itself can be broken down into 3 main
categories
• System Software: is designed to operate the computer’s hardware and to
provide and maintain a platform for running applications. (e.g., Windows,
MacOS, Linux, Unix, etc..)
• Middleware: is a set of services that allows multiple processes running on
one or more machines to interact.
• Most often used to support and simplify complex distributed applications.
It can also allow data contained in one database to be accessed through
another.
• Middleware is sometimes called plumbing because it connects two
applications and passes data between them. (e.g., web servers,
application servers).
18 Jan 2020 13
• Application Software: is designed to help the user perform
one or more related specific tasks. Depending on the work
for which it was designed, an application can manipulate
text, numbers, graphics, or a combination of these
elements. (e.g., office suites, web browsers, video games)
• Computer science is the study of the theoretical
foundations of information and computation, and of
practical techniques for their implementation and
application in computer systems (Wikipedia)., media
players, etc…)
• A program is a sequence of instructions that can be
executed by a computer to solve some problem or
perform a specified task
18 Jan 2020 14
• A programming language is an artificial
language designed to automate the task of
organizing and manipulating information,
and to express problem solutions precisely.
18 Jan 2020 15
• A programming language “boils down to” a set of words, rules
and tools that are used to explain (or define) what you are
trying to accomplish.
• There are many different programming languages just as
there are many different "spoken" languages.
• Traditional programming languages were known as structural
programming languages (e.g., C, Fortran, Pascal, Cobol, Basic).
• Since the late 80's however, object-oriented programming
languages have become more popular (e.g., JAVA, C++, C#)
18 Jan 2020 16
Problem Solving, Programming and
Python Programming
Lectures: 07 Hrs
• General problem solving concepts :
• Problem solving in everyday life,
• types of problems, problem solving with computers,
• difficulties with problem solving
• problem solving aspects, top down design. Problem Solving Strategies
• Program Design Tools: Algorithms, Flowcharts and Pseudo-codes,
implementation of algorithms.
• Basics of Python Programming: Features of Python, History and Future of Python,
Writing and executing Python program, Literal constants, variables and identifiers,
Data Types, Input operation, Comments, Reserved words, Indentation, Operators
and expressions, Expressions in Python.
What is problem?
• The problem is defined as the objective or the
specific output that we want to attain;
• through a sequence of steps and activities
and, specific input.
What is PAID?
• A logical problem solving process can be done through
some steps called "PAID"
• • Problem Statement.
• • Analyze the problem in detail.
• • Identify likely causes.
• • Define actual cause(s).
Example problem in daily life
Strategies
• Ask questions!
What do I know about the problem?
What is the information that I have to process in
order the find the solution?
What does the solution look like?
What sort of special cases exist?
How will I recognize that I have found
the solution?
Problem Solving Definition
• A Systematic approach to defining problem(question or situation that
presents uncertainty or difficulty) and creating a vast number of
possible solutions without judging these solutions.
Problem Solving Definition
• A Systematic approach to defining problem
and creating a vast number of possible
solutions without which will gives maximum
accuracy.
Problem Solving in Everyday Life
• There are six step in problem solving:
Problem Solving in Everyday Life
• Can I
skip
the
step?
Can I skip
the step?
According to Sprankle and
Hubbard (2012), if the six step
not completed well, the result
may be less than desired
Example problems…
• Baking a cake according to certain
specifications, input available are the
ingredients (such as eggs, flour, milk …etc.),
then followed by activities or procedures that
should be done sequentially, taking into
consideration that any mistake happens by
doing any procedure before the other, results
in an unsuitable and undesirable cake.
Problem Solving with Computers
• Definitions by Sprankle & Hubbard (2012):
SOLUTION
instructions
followed to
produce best
result
RESULT
Outcome OR
completed
computer-
assisted answer
PROGRAM
Set of
instructions for
solution using
computer
language
Difficulties with Problem Solving
Group Activities
• In in group of 4 persons, think a problems in
your daily life at home, office, park, school,
shopping mall or wherever your go. Please
explain how you solve the problem using the
six steps of problem solving.
Problem Solving with Computer
• Two methodologies used to develop computer
solutions to a problem
– Top-down design focuses on the tasks to be done
– Object-oriented design focuses on the data
involved in the solution
• But first, let's look at a way to express
algorithms: pseudo code
Different approaches to designing an
algorithm
• Top down approach
• Bottom up approach
Top-Down Design
• Top-Down Design
• Problem-solving technique in which the problem is divided
into
• Sub problems; the process is applied to each sub problem.
• Modules
• Self-contained collection of steps, that solve a problem or
sub problem.
• Abstract Step
• An algorithmic step containing unspecified details.
• Concrete Step
• An algorithm step in which all details are specified
A General Example
Planning a large
party
Top Down Vs Bottom Up
• Generation of test cases • Allows information
hiding asit fristb
Control Structure Used in Algorithm
• An algorithm has finite no of step and some
step may involved decision making decision .
•
Sequence
Decision
Repetition
• Sequential: default mode. Sequential execution of code statements
(one line after another) -- like following a recipe
• Selection: used for decisions, branching -- choosing between 2 or
more alternative paths. In C++, these are the types of selection
statements:
– if
– if/else
– switch
• Repetition: used for looping, i.e. repeating a piece of code multiple
times in a row. In C++, there are three types of loops:
– while
– do/while
– for
Sequence
4 ALGORITHMIC PROBLEM SOLVING
STEPS
• Understanding the problem
• 2. Determining the capabilities of the
computational device
• 3. Exact/approximate solution
• 4. Select the appropriate data structure
• 5. Algorithm design techniques
• 6. Methods of specifying an algorithm
• 7. Proving an algorithms correctness
• 8. Analysing the performance of an algorithm
Understanding the problem
• Understanding the problem The problem
given should be clearly and completely
understood.
• It is compared with earlier problems that
have already been solved to check if it is
similar to them and a known algorithm exists.
If the algorithm is available, it is used
otherwise a new one has to be developed.
• Determining the capabilities of the
computational device After understanding the
problem, the capabilities of the computing
device should be known. For this, the type of
the architecture, speed and memory
availability of the device are noted.
Exact/approximate solution
• The next step is to develop the algorithm. The
algorithm must compute correct output for all
possible and legitimate inputs.
• This solution can be an exact solution or an
approximate solution.
• For example, you can only have an
approximate solution in case of finding square
root of number or finding the solutions of
nonlinear equations
• Select the appropriate data structure A data
type is a well-defined collection of data with a
well defined set of operations on it.
• A data structure is basically a group of data
elements that are put together under one
name, and which defines a particular way of
storing and organizing data in a computer so
that it can be used efficiently.
• The elementary data structures are as follows.
SIMPLE STRATEGIES AND NOTATIONS
FOR DEVELOPING ALGORITHMS
• An algorithm is a step–by–step procedure for solving a
task or problem.
• Unambiguous and finite in number.
• Basically, an algorithm is nothing but English-like
representation of logic which is used to solve the
problem.
• For accomplishing a particular task, different
algorithms can be written.
• The different algorithms differ in their requirements of
CPU time and memory space.
• The programmer selects the best suited algorithm for
the given task to be solved
Control Structures Used in Algorithms
• An algorithm has a finite number of steps and
some steps may involve decision making and
repetition. Broadly speaking, an algorithm
may employ three control structures, namely,
sequence, decision, and repetition
Algorithm to add two numbers
• Step 1 : Start
• Step 2 : Input first number as A
• Step 3 : Input second number as B
• Step 4 : Set Sum = A + B
• Step 5 : Print Sum
• Step 6 : End
Decision statements
• are used when the outcome of the process
depends on some condition.
• For example,
• if x = y, then print “EQUAL”.
• Hence, the general form of the if construct can be
given as follows:
• IF condition
– then
• process
• A decision statement can also be stated in the
following manner:
• IF condition
–then process1
ELSE
–process2
Algorithm to test the quality of two
numbers
• Step 1 : Start
• Step 2 : Input first number as A
• Step 3 : Input second number as B
• Step 4 : IF A = B Print "Equal" ELSE Print "Not
equal" [END of IF]
• Step 5 : End
Algorithm to find the greatest of three
numbers
• Step 1: Start
• Step 2: Read the three numbers A,B,C
Algorithm to find the greatest of three numbers
using an additional variable MAX
Programming basics
• code or source code: The sequence of instructions in a
program.
• syntax: The set of legal structures and commands that can be
used in a particular programming language.
• output: The messages printed to the user by a program.
• console: The text box onto which output is printed.
– Some source code editors pop up the console as an
external window, and others contain their own console
window.
What is Python?
• Python is a general purpose interpreted interactive
object oriented and high level programming language.
• It was first introduced in 1991 by Guido van Rossum , a
Dutch computer programmer.
• The language places strong emphasis on code reliability
and simplicity so that the programmers can develop
applications rapidly
• Python is multi-paradigm programming language ,which allows user to
code in several different programming styles.
• Python supports cross platform development and is available through
open source.
• Python is widely used for scripting in Game menu applications
effectively.
History of Python
• Python is created by Guido Van Rossum in the 1980s.
• Rossum published the first version of Python code (0.9.0) in February
1991 at the CWI (Centrum Wiskunde & Informatics) in the Netherlands
, Amsterdam.
• Python is derived from ABC programming language, which is a general-
purpose programming language that had been developed at the CWI.
• Rossum chose the name "Python", since he was a big fan of Monty
Python's Flying Circus.
• Python is now maintained by a core development team at the institute,
• although Rossum still holds a vital role in directing its progress.
Why do people use Python…?
• The following primary factors cited by Python users seem to be
these:
• Python is object-oriented Structure supports such concepts as
polymorphism, operation overloading, and multiple inheritance.
• Indentation is one of the greatest future in Python.
• It's free (open source)
• Downloading and installing Python is free and easy Source code is
easily accessible
• It's powerful
• - Dynamic typing
• - Built-in types and tools
• - Library utilities
• - Third party utilities (e.g. Numeric, NumPy, SciPy)
• - Automatic memory management
• It's portable
• - Python runs virtually every major platform used today
• - As long as you have a compatible Python interpreter installed,
• Python programs will run in exactly the same manner, irrespective of platform.
Python Versions
 Release dates for the major and minor versions:
 Python 1.0 - January 1994
 Python 1.5 - December 31, 1997
 Python 1.6 - September 5, 2000
 Python 2.0 - October 16, 2000
 Python 2.1 - April 17, 2001
 Python 2.2 - December 21, 2001
 Python 2.3 - July 29, 2003
 Python 2.4 - November 30, 2004
 Python 2.5 - September 19, 2006
 Python 2.6 - October 1, 2008
 Python 2.7 - July 3, 2010
 Release dates for the major and minor versions:
 Python 3.0 - December 3, 2008
 Python 3.1 - June 27, 2009
 Python 3.2 - February 20, 2011
 Python 3.3 - September 29, 2012
 Python 3.4 - March 16, 2014
 Python 3.5 - September 13, 2015
Python Code Execution
• Python’s traditional runtime execution model:
source code you type is translated to byte
code, which is then run by the Python Virtual
Machine. Your code is automatically compiled,
but then it is interpreted
• Source code extension is .py
• Byte code extension is .pyc (compiled python
code)
Your First Program
• To develop the Python program ,click on the File and select
NewFile.
• • This will open a new text editor where you can write your
first program.
# Prints the words Hello Python
print(“Hello Python”)
print(“Its nice learning Python”)
print(“Python is easy to learn”)
Data types in Python
• Every value in Python has a datatype. Since everything is an object
in Python programming, data types are actually classes and
variables are instance (object) of these classes.
• There are various data types in Python. Some of the important
types are listed below.
• Python Numbers
• Integers, floating point numbers and complex numbers falls under
Python numbers category. They are defined as int, float and
complex class in Python.
• We can use the type() function to know which class a variable or a
value belongs to and the isinstance() function to check if an object
belongs to a particular class.
• >>>a = 5
print(a, "is of type", type(a))
• >>>a = 2.0
print(a, "is of type", type(a))
• >>>a = 1+2j
print(a, "is complex number?", isinstance(1+2j,complex))
Datatype: Python List
• List is an ordered sequence of items. It is one of the most used datatype
in Python and is very flexible. All the items in a list do not need to be of
the same type.
• Declaring a list is pretty straight forward. Items separated by commas are
enclosed within brackets [ ].
• >>> a = [1, 2.2, 'python']
• We can use the slicing operator [ ] to extract an item or a range of items
from a list.
• Index starts form 0 in Python.
Example
• a = [5,10,15,20,25,30,35,40]
• # a[2] = ?
• print("a[2] = ", a[2])
• # a[0:3] = ?
• print("a[0:3] = ", a[0:3])
• # a[5:] =
• print("a[5:] = ", a[5:])
Datatype: Python Tuple
Tuple is an ordered sequence of items same as list.
The only difference is that tuples are immutable. Tuples once created cannot
be modified.
Tuples are used to write-protect data and are usually faster than list as it
cannot change dynamically.
It is defined within parentheses () where items are separated by commas.
>>> t = (5,'program', 1+3j)
We can use the slicing operator [] to extract items but we cannot change its
value.
Example
• t = (5,'program', 1+3j)
• # t[1] = ?
• print("t[1] = ", t[1])
• # t[0:3] = ?
• print("t[0:3] = ", t[0:3])
• # Generates error
• # Tuples are immutablet[0] = 10
Datatype: Python Strings
• String is sequence of Unicode characters. We can use single
quotes or double quotes to represent strings. Multi-line
strings can be denoted using triple quotes, ''' or """.
• >>> s = "This is a string"
• >>> s = '''a multiline
• Like list and tuple, slicing operator [ ] can be used with
string. Strings are immutable.
Example
s = 'Hello world!’
# s[4] = ?
print("s[4] = ", s[4])
# s[6:11] = ?
print("s[6:11] = ", s[6:11])
# Generates error
# Strings are immutable in Python
s[5] =?
End of Unit No 1
Unit no_1.pptx

More Related Content

Similar to Unit no_1.pptx

Data structures and algorithms Module-1.pdf
Data structures and algorithms Module-1.pdfData structures and algorithms Module-1.pdf
Data structures and algorithms Module-1.pdfDukeCalvin
 
Design and Analysis Algorithms.pdf
Design and Analysis Algorithms.pdfDesign and Analysis Algorithms.pdf
Design and Analysis Algorithms.pdfHarshNagda5
 
Makine Öğrenmesi, Yapay Zeka ve Veri Bilimi Süreçlerinin Otomatikleştirilmesi...
Makine Öğrenmesi, Yapay Zeka ve Veri Bilimi Süreçlerinin Otomatikleştirilmesi...Makine Öğrenmesi, Yapay Zeka ve Veri Bilimi Süreçlerinin Otomatikleştirilmesi...
Makine Öğrenmesi, Yapay Zeka ve Veri Bilimi Süreçlerinin Otomatikleştirilmesi...Ali Alkan
 
Overview of Software Engineering Principles - SCPS311.pptx
Overview of Software Engineering Principles - SCPS311.pptxOverview of Software Engineering Principles - SCPS311.pptx
Overview of Software Engineering Principles - SCPS311.pptxBypassFrp
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programmingSangheethaa Sukumaran
 
C programming for Computing Techniques
C programming for Computing TechniquesC programming for Computing Techniques
C programming for Computing TechniquesAppili Vamsi Krishna
 
Computational thinking
Computational thinkingComputational thinking
Computational thinkingr123457
 
Algorithms-Flowcharts-Data-Types-and-Pseudocodes.pptx
Algorithms-Flowcharts-Data-Types-and-Pseudocodes.pptxAlgorithms-Flowcharts-Data-Types-and-Pseudocodes.pptx
Algorithms-Flowcharts-Data-Types-and-Pseudocodes.pptxRobertCarreonBula
 
Data structures & problem solving unit 1 ppt
Data structures & problem solving unit 1 pptData structures & problem solving unit 1 ppt
Data structures & problem solving unit 1 pptaviban
 
COM1407: Structured Program Development
COM1407: Structured Program Development COM1407: Structured Program Development
COM1407: Structured Program Development Hemantha Kulathilake
 
Data Science.pptx NEW COURICUUMN IN DATA
Data Science.pptx NEW COURICUUMN IN DATAData Science.pptx NEW COURICUUMN IN DATA
Data Science.pptx NEW COURICUUMN IN DATAjaved75
 

Similar to Unit no_1.pptx (20)

Data structures and algorithms Module-1.pdf
Data structures and algorithms Module-1.pdfData structures and algorithms Module-1.pdf
Data structures and algorithms Module-1.pdf
 
lect 1-ds algo(final)_2.pdf
lect 1-ds  algo(final)_2.pdflect 1-ds  algo(final)_2.pdf
lect 1-ds algo(final)_2.pdf
 
Design and Analysis Algorithms.pdf
Design and Analysis Algorithms.pdfDesign and Analysis Algorithms.pdf
Design and Analysis Algorithms.pdf
 
Lecture 1 (bce-7)
Lecture   1 (bce-7)Lecture   1 (bce-7)
Lecture 1 (bce-7)
 
Makine Öğrenmesi, Yapay Zeka ve Veri Bilimi Süreçlerinin Otomatikleştirilmesi...
Makine Öğrenmesi, Yapay Zeka ve Veri Bilimi Süreçlerinin Otomatikleştirilmesi...Makine Öğrenmesi, Yapay Zeka ve Veri Bilimi Süreçlerinin Otomatikleştirilmesi...
Makine Öğrenmesi, Yapay Zeka ve Veri Bilimi Süreçlerinin Otomatikleştirilmesi...
 
RAJAT PROJECT.pptx
RAJAT PROJECT.pptxRAJAT PROJECT.pptx
RAJAT PROJECT.pptx
 
algo 1.ppt
algo 1.pptalgo 1.ppt
algo 1.ppt
 
Overview of Software Engineering Principles - SCPS311.pptx
Overview of Software Engineering Principles - SCPS311.pptxOverview of Software Engineering Principles - SCPS311.pptx
Overview of Software Engineering Principles - SCPS311.pptx
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programming
 
CC-112-Lec.1.ppsx
CC-112-Lec.1.ppsxCC-112-Lec.1.ppsx
CC-112-Lec.1.ppsx
 
Algorithm.pdf
Algorithm.pdfAlgorithm.pdf
Algorithm.pdf
 
C programming for Computing Techniques
C programming for Computing TechniquesC programming for Computing Techniques
C programming for Computing Techniques
 
Computational thinking
Computational thinkingComputational thinking
Computational thinking
 
Algorithms-Flowcharts-Data-Types-and-Pseudocodes.pptx
Algorithms-Flowcharts-Data-Types-and-Pseudocodes.pptxAlgorithms-Flowcharts-Data-Types-and-Pseudocodes.pptx
Algorithms-Flowcharts-Data-Types-and-Pseudocodes.pptx
 
Data structures & problem solving unit 1 ppt
Data structures & problem solving unit 1 pptData structures & problem solving unit 1 ppt
Data structures & problem solving unit 1 ppt
 
Lec1.ppt
Lec1.pptLec1.ppt
Lec1.ppt
 
COM1407: Structured Program Development
COM1407: Structured Program Development COM1407: Structured Program Development
COM1407: Structured Program Development
 
computer Unit 8
computer Unit 8computer Unit 8
computer Unit 8
 
Data Science.pptx NEW COURICUUMN IN DATA
Data Science.pptx NEW COURICUUMN IN DATAData Science.pptx NEW COURICUUMN IN DATA
Data Science.pptx NEW COURICUUMN IN DATA
 
Lecture 5 ml
Lecture 5 mlLecture 5 ml
Lecture 5 ml
 

Recently uploaded

Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
Piping Basic stress analysis by engineering
Piping Basic stress analysis by engineeringPiping Basic stress analysis by engineering
Piping Basic stress analysis by engineeringJuanCarlosMorales19600
 
Solving The Right Triangles PowerPoint 2.ppt
Solving The Right Triangles PowerPoint 2.pptSolving The Right Triangles PowerPoint 2.ppt
Solving The Right Triangles PowerPoint 2.pptJasonTagapanGulla
 
Vishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsVishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsSachinPawar510423
 
welding defects observed during the welding
welding defects observed during the weldingwelding defects observed during the welding
welding defects observed during the weldingMuhammadUzairLiaqat
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptMadan Karki
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEroselinkalist12
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleAlluxio, Inc.
 
lifi-technology with integration of IOT.pptx
lifi-technology with integration of IOT.pptxlifi-technology with integration of IOT.pptx
lifi-technology with integration of IOT.pptxsomshekarkn64
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...121011101441
 
computer application and construction management
computer application and construction managementcomputer application and construction management
computer application and construction managementMariconPadriquez1
 
US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionMebane Rash
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...Chandu841456
 

Recently uploaded (20)

Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
Piping Basic stress analysis by engineering
Piping Basic stress analysis by engineeringPiping Basic stress analysis by engineering
Piping Basic stress analysis by engineering
 
Solving The Right Triangles PowerPoint 2.ppt
Solving The Right Triangles PowerPoint 2.pptSolving The Right Triangles PowerPoint 2.ppt
Solving The Right Triangles PowerPoint 2.ppt
 
Vishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsVishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documents
 
welding defects observed during the welding
welding defects observed during the weldingwelding defects observed during the welding
welding defects observed during the welding
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.ppt
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at Scale
 
lifi-technology with integration of IOT.pptx
lifi-technology with integration of IOT.pptxlifi-technology with integration of IOT.pptx
lifi-technology with integration of IOT.pptx
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...
 
computer application and construction management
computer application and construction managementcomputer application and construction management
computer application and construction management
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of Action
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...
 

Unit no_1.pptx

  • 1. PPS Unit No 1 PPS Unit No 1
  • 4. What is a Computer • It is electronic machine. • Data is collection of raw facts or figure • Information • Knowledge • Instructions • Program • Software • Hardware
  • 6.
  • 7. History of Computer • First Generation(1942-1955) • Second Generation(1955-1964) • Third Generation(1964-1975) • Fourth Generation(1975-1989)
  • 8. Performs computations and makes logical decisions Millions / billions times faster than human beings Computer programs Sets of instructions for which computer processes data  Hardware. Physical devices of computer system.  Software. Programs that run on computers .
  • 9. What is Computer Science ? • It will help you understand that the goal of a computer scientist is to solve problems using computers. • You will see how problems are formulated by means of algorithms and how the process of abstraction can be used to break problems down to easily manageable pieces. • 18 Jan 2020 9
  • 10. What is Computer Science ?  Computers are used just about everywhere in our society:  Communications: internet, e-mail, cell phones  Word Processing: typing/printing documents  Business Applications: Accounting, spreadsheets  Entertainment: Games, Multimedia Applications  Database Management: Police Records, Stock Market  Engineering Applications: Scientific Analysis, simulations  Manufacturing: CAD/CAM, Robotics, Assembly 18 Jan 2020 10
  • 11. • A computer is a programmable machine that receives input, stores and manipulates data, and provides output in a useful format.
  • 12.
  • 13. Software itself can be broken down into 3 main categories • System Software: is designed to operate the computer’s hardware and to provide and maintain a platform for running applications. (e.g., Windows, MacOS, Linux, Unix, etc..) • Middleware: is a set of services that allows multiple processes running on one or more machines to interact. • Most often used to support and simplify complex distributed applications. It can also allow data contained in one database to be accessed through another. • Middleware is sometimes called plumbing because it connects two applications and passes data between them. (e.g., web servers, application servers). 18 Jan 2020 13
  • 14. • Application Software: is designed to help the user perform one or more related specific tasks. Depending on the work for which it was designed, an application can manipulate text, numbers, graphics, or a combination of these elements. (e.g., office suites, web browsers, video games) • Computer science is the study of the theoretical foundations of information and computation, and of practical techniques for their implementation and application in computer systems (Wikipedia)., media players, etc…) • A program is a sequence of instructions that can be executed by a computer to solve some problem or perform a specified task 18 Jan 2020 14
  • 15. • A programming language is an artificial language designed to automate the task of organizing and manipulating information, and to express problem solutions precisely. 18 Jan 2020 15
  • 16. • A programming language “boils down to” a set of words, rules and tools that are used to explain (or define) what you are trying to accomplish. • There are many different programming languages just as there are many different "spoken" languages. • Traditional programming languages were known as structural programming languages (e.g., C, Fortran, Pascal, Cobol, Basic). • Since the late 80's however, object-oriented programming languages have become more popular (e.g., JAVA, C++, C#) 18 Jan 2020 16
  • 17. Problem Solving, Programming and Python Programming Lectures: 07 Hrs • General problem solving concepts : • Problem solving in everyday life, • types of problems, problem solving with computers, • difficulties with problem solving • problem solving aspects, top down design. Problem Solving Strategies • Program Design Tools: Algorithms, Flowcharts and Pseudo-codes, implementation of algorithms. • Basics of Python Programming: Features of Python, History and Future of Python, Writing and executing Python program, Literal constants, variables and identifiers, Data Types, Input operation, Comments, Reserved words, Indentation, Operators and expressions, Expressions in Python.
  • 18. What is problem? • The problem is defined as the objective or the specific output that we want to attain; • through a sequence of steps and activities and, specific input.
  • 19. What is PAID? • A logical problem solving process can be done through some steps called "PAID" • • Problem Statement. • • Analyze the problem in detail. • • Identify likely causes. • • Define actual cause(s).
  • 20. Example problem in daily life
  • 21.
  • 22. Strategies • Ask questions! What do I know about the problem? What is the information that I have to process in order the find the solution? What does the solution look like? What sort of special cases exist? How will I recognize that I have found the solution?
  • 23. Problem Solving Definition • A Systematic approach to defining problem(question or situation that presents uncertainty or difficulty) and creating a vast number of possible solutions without judging these solutions.
  • 24. Problem Solving Definition • A Systematic approach to defining problem and creating a vast number of possible solutions without which will gives maximum accuracy.
  • 25. Problem Solving in Everyday Life • There are six step in problem solving:
  • 26. Problem Solving in Everyday Life • Can I skip the step? Can I skip the step? According to Sprankle and Hubbard (2012), if the six step not completed well, the result may be less than desired
  • 27. Example problems… • Baking a cake according to certain specifications, input available are the ingredients (such as eggs, flour, milk …etc.), then followed by activities or procedures that should be done sequentially, taking into consideration that any mistake happens by doing any procedure before the other, results in an unsuitable and undesirable cake.
  • 28. Problem Solving with Computers • Definitions by Sprankle & Hubbard (2012): SOLUTION instructions followed to produce best result RESULT Outcome OR completed computer- assisted answer PROGRAM Set of instructions for solution using computer language
  • 30. Group Activities • In in group of 4 persons, think a problems in your daily life at home, office, park, school, shopping mall or wherever your go. Please explain how you solve the problem using the six steps of problem solving.
  • 31. Problem Solving with Computer • Two methodologies used to develop computer solutions to a problem – Top-down design focuses on the tasks to be done – Object-oriented design focuses on the data involved in the solution • But first, let's look at a way to express algorithms: pseudo code
  • 32. Different approaches to designing an algorithm • Top down approach • Bottom up approach
  • 33. Top-Down Design • Top-Down Design • Problem-solving technique in which the problem is divided into • Sub problems; the process is applied to each sub problem. • Modules • Self-contained collection of steps, that solve a problem or sub problem. • Abstract Step • An algorithmic step containing unspecified details. • Concrete Step • An algorithm step in which all details are specified
  • 34. A General Example Planning a large party
  • 35. Top Down Vs Bottom Up • Generation of test cases • Allows information hiding asit fristb
  • 36. Control Structure Used in Algorithm • An algorithm has finite no of step and some step may involved decision making decision . • Sequence Decision Repetition
  • 37. • Sequential: default mode. Sequential execution of code statements (one line after another) -- like following a recipe • Selection: used for decisions, branching -- choosing between 2 or more alternative paths. In C++, these are the types of selection statements: – if – if/else – switch • Repetition: used for looping, i.e. repeating a piece of code multiple times in a row. In C++, there are three types of loops: – while – do/while – for Sequence
  • 38.
  • 39.
  • 40. 4 ALGORITHMIC PROBLEM SOLVING STEPS • Understanding the problem • 2. Determining the capabilities of the computational device • 3. Exact/approximate solution • 4. Select the appropriate data structure • 5. Algorithm design techniques • 6. Methods of specifying an algorithm • 7. Proving an algorithms correctness • 8. Analysing the performance of an algorithm
  • 41. Understanding the problem • Understanding the problem The problem given should be clearly and completely understood. • It is compared with earlier problems that have already been solved to check if it is similar to them and a known algorithm exists. If the algorithm is available, it is used otherwise a new one has to be developed.
  • 42. • Determining the capabilities of the computational device After understanding the problem, the capabilities of the computing device should be known. For this, the type of the architecture, speed and memory availability of the device are noted.
  • 43. Exact/approximate solution • The next step is to develop the algorithm. The algorithm must compute correct output for all possible and legitimate inputs. • This solution can be an exact solution or an approximate solution. • For example, you can only have an approximate solution in case of finding square root of number or finding the solutions of nonlinear equations
  • 44. • Select the appropriate data structure A data type is a well-defined collection of data with a well defined set of operations on it. • A data structure is basically a group of data elements that are put together under one name, and which defines a particular way of storing and organizing data in a computer so that it can be used efficiently. • The elementary data structures are as follows.
  • 45. SIMPLE STRATEGIES AND NOTATIONS FOR DEVELOPING ALGORITHMS • An algorithm is a step–by–step procedure for solving a task or problem. • Unambiguous and finite in number. • Basically, an algorithm is nothing but English-like representation of logic which is used to solve the problem. • For accomplishing a particular task, different algorithms can be written. • The different algorithms differ in their requirements of CPU time and memory space. • The programmer selects the best suited algorithm for the given task to be solved
  • 46. Control Structures Used in Algorithms • An algorithm has a finite number of steps and some steps may involve decision making and repetition. Broadly speaking, an algorithm may employ three control structures, namely, sequence, decision, and repetition
  • 47. Algorithm to add two numbers • Step 1 : Start • Step 2 : Input first number as A • Step 3 : Input second number as B • Step 4 : Set Sum = A + B • Step 5 : Print Sum • Step 6 : End
  • 48. Decision statements • are used when the outcome of the process depends on some condition. • For example, • if x = y, then print “EQUAL”. • Hence, the general form of the if construct can be given as follows: • IF condition – then • process
  • 49. • A decision statement can also be stated in the following manner: • IF condition –then process1 ELSE –process2
  • 50. Algorithm to test the quality of two numbers • Step 1 : Start • Step 2 : Input first number as A • Step 3 : Input second number as B • Step 4 : IF A = B Print "Equal" ELSE Print "Not equal" [END of IF] • Step 5 : End
  • 51. Algorithm to find the greatest of three numbers • Step 1: Start • Step 2: Read the three numbers A,B,C
  • 52. Algorithm to find the greatest of three numbers using an additional variable MAX
  • 53.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58. Programming basics • code or source code: The sequence of instructions in a program. • syntax: The set of legal structures and commands that can be used in a particular programming language. • output: The messages printed to the user by a program. • console: The text box onto which output is printed. – Some source code editors pop up the console as an external window, and others contain their own console window.
  • 59. What is Python? • Python is a general purpose interpreted interactive object oriented and high level programming language. • It was first introduced in 1991 by Guido van Rossum , a Dutch computer programmer. • The language places strong emphasis on code reliability and simplicity so that the programmers can develop applications rapidly
  • 60. • Python is multi-paradigm programming language ,which allows user to code in several different programming styles. • Python supports cross platform development and is available through open source. • Python is widely used for scripting in Game menu applications effectively.
  • 61. History of Python • Python is created by Guido Van Rossum in the 1980s. • Rossum published the first version of Python code (0.9.0) in February 1991 at the CWI (Centrum Wiskunde & Informatics) in the Netherlands , Amsterdam. • Python is derived from ABC programming language, which is a general- purpose programming language that had been developed at the CWI. • Rossum chose the name "Python", since he was a big fan of Monty Python's Flying Circus. • Python is now maintained by a core development team at the institute, • although Rossum still holds a vital role in directing its progress.
  • 62. Why do people use Python…? • The following primary factors cited by Python users seem to be these: • Python is object-oriented Structure supports such concepts as polymorphism, operation overloading, and multiple inheritance. • Indentation is one of the greatest future in Python. • It's free (open source) • Downloading and installing Python is free and easy Source code is easily accessible
  • 63. • It's powerful • - Dynamic typing • - Built-in types and tools • - Library utilities • - Third party utilities (e.g. Numeric, NumPy, SciPy) • - Automatic memory management • It's portable • - Python runs virtually every major platform used today • - As long as you have a compatible Python interpreter installed, • Python programs will run in exactly the same manner, irrespective of platform.
  • 64. Python Versions  Release dates for the major and minor versions:  Python 1.0 - January 1994  Python 1.5 - December 31, 1997  Python 1.6 - September 5, 2000  Python 2.0 - October 16, 2000  Python 2.1 - April 17, 2001  Python 2.2 - December 21, 2001  Python 2.3 - July 29, 2003  Python 2.4 - November 30, 2004  Python 2.5 - September 19, 2006  Python 2.6 - October 1, 2008  Python 2.7 - July 3, 2010  Release dates for the major and minor versions:  Python 3.0 - December 3, 2008  Python 3.1 - June 27, 2009  Python 3.2 - February 20, 2011  Python 3.3 - September 29, 2012  Python 3.4 - March 16, 2014  Python 3.5 - September 13, 2015
  • 65.
  • 66.
  • 67. Python Code Execution • Python’s traditional runtime execution model: source code you type is translated to byte code, which is then run by the Python Virtual Machine. Your code is automatically compiled, but then it is interpreted
  • 68. • Source code extension is .py • Byte code extension is .pyc (compiled python code)
  • 69. Your First Program • To develop the Python program ,click on the File and select NewFile. • • This will open a new text editor where you can write your first program. # Prints the words Hello Python print(“Hello Python”) print(“Its nice learning Python”) print(“Python is easy to learn”)
  • 70. Data types in Python • Every value in Python has a datatype. Since everything is an object in Python programming, data types are actually classes and variables are instance (object) of these classes. • There are various data types in Python. Some of the important types are listed below. • Python Numbers • Integers, floating point numbers and complex numbers falls under Python numbers category. They are defined as int, float and complex class in Python. • We can use the type() function to know which class a variable or a value belongs to and the isinstance() function to check if an object belongs to a particular class.
  • 71. • >>>a = 5 print(a, "is of type", type(a)) • >>>a = 2.0 print(a, "is of type", type(a)) • >>>a = 1+2j print(a, "is complex number?", isinstance(1+2j,complex))
  • 72. Datatype: Python List • List is an ordered sequence of items. It is one of the most used datatype in Python and is very flexible. All the items in a list do not need to be of the same type. • Declaring a list is pretty straight forward. Items separated by commas are enclosed within brackets [ ]. • >>> a = [1, 2.2, 'python'] • We can use the slicing operator [ ] to extract an item or a range of items from a list. • Index starts form 0 in Python.
  • 73. Example • a = [5,10,15,20,25,30,35,40] • # a[2] = ? • print("a[2] = ", a[2]) • # a[0:3] = ? • print("a[0:3] = ", a[0:3]) • # a[5:] = • print("a[5:] = ", a[5:])
  • 74. Datatype: Python Tuple Tuple is an ordered sequence of items same as list. The only difference is that tuples are immutable. Tuples once created cannot be modified. Tuples are used to write-protect data and are usually faster than list as it cannot change dynamically. It is defined within parentheses () where items are separated by commas. >>> t = (5,'program', 1+3j) We can use the slicing operator [] to extract items but we cannot change its value.
  • 75. Example • t = (5,'program', 1+3j) • # t[1] = ? • print("t[1] = ", t[1]) • # t[0:3] = ? • print("t[0:3] = ", t[0:3]) • # Generates error • # Tuples are immutablet[0] = 10
  • 76. Datatype: Python Strings • String is sequence of Unicode characters. We can use single quotes or double quotes to represent strings. Multi-line strings can be denoted using triple quotes, ''' or """. • >>> s = "This is a string" • >>> s = '''a multiline • Like list and tuple, slicing operator [ ] can be used with string. Strings are immutable.
  • 77. Example s = 'Hello world!’ # s[4] = ? print("s[4] = ", s[4]) # s[6:11] = ? print("s[6:11] = ", s[6:11]) # Generates error # Strings are immutable in Python s[5] =?
  • 78. End of Unit No 1