0% found this document useful (0 votes)
140 views31 pages

B.Tech - CSE Semester - I: Topic For The Class: Unit 1: Title: Date & Time

The document outlines a class on an introduction to problem solving and programming with Python, including basic computer science terminology, an overview of the course syllabus, and introductions to computational thinking, problem solving, and programming languages. Key topics covered are the definitions of computers, programs, software, programming languages, and the steps of problem solving using computers.

Uploaded by

mahindra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
140 views31 pages

B.Tech - CSE Semester - I: Topic For The Class: Unit 1: Title: Date & Time

The document outlines a class on an introduction to problem solving and programming with Python, including basic computer science terminology, an overview of the course syllabus, and introductions to computational thinking, problem solving, and programming languages. Key topics covered are the definitions of computers, programs, software, programming languages, and the steps of problem solving using computers.

Uploaded by

mahindra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 31

B.

Tech - CSE Semester – I


Course ID, Course Name: 19EID133, Problem Solving and Programming with Python
Topic for the class: Introduction to Problem Solving and Programming with Python
Unit 1 : Title :Computational Thinking and Visual Programming Concepts
Date & Time : 28-09-2020 11 am – 12pm
Dr.S.Anuradha
Assistant Professor
Department of Computer Science and Engineering
GITAM Institute of Technology (GIT)
GITAM(Deemed to be University), Visakhapatnam – 530045
Email: [email protected]

8/28/2020 Department of Computer Science and Engineering 19EID133 Problem Solving and Programming with Python 1
Session Objective :

1. Understand the basic terminologies related to Computer Science


and Engineering.

2. Introduce Problem Solving and Programming(PSP) concept.

8/28/2020 Department of Computer Science and Engineering 19EID133 Problem Solving and Programming with Python 2
Topics to be Discussed GITAM
Deemed to be University
• Basic Terminologies related to Computer Programming.
• Introduction to Problem Solving
– What is a Problem?
– What is Problem Solving?
– Steps in Problem Solving
• PSP syllabus overview

8/28/2020 Department of Computer Science and Engineering 19EID133 Problem Solving and Programming with Python 3
BASIC TERMINOLOGIES RELATED TO COMPUTER PROGRAMMING GITAM
Deemed to be University
“Computer Science is a science of abstraction -creating the right model for a problem and devising the
appropriate mechanizable techniques to solve it.”
–A. Aho and J. Ullman

CAN U IMAGINE A LIFE WITHOUT COMPUTERS?


Today, computers are all around us. We use them for doing various tasks in a faster and more accurate
manner. Computers are used everywhere in banks, hospitals, Missile and satellite, aircraft, toys, washing
machines etc.

Computers are used for solving various day-to-day problems and thus problem solving is an essential skill that
a computer science student should try to develop.

8/28/2020 Department of Computer Science and Engineering 19EID133 Problem Solving and Programming with Python 4
BASIC TERMINOLOGIES RELATED TO COMPUTER PROGRAMMING GITAM
Deemed to be University
COMPUTER
 A computer is a fast electronic calculating device which accepts input information from
the user, processes it according to a program stored in its memory and produces output
information.
Since a computer can neither think nor make a decision on its own, it needs a program
which will convey what is to be done.
Computer Program
A program is a set of instructions following the rules of the chosen language. Without
programs, computers are useless. A program is like a recipe. It contains a list of
ingredients (called variables) and a list of directions (called statements) that tell the
computer what to do with the variables.
8/28/2020 Department of Computer Science and Engineering 19EID133 Problem Solving and Programming with Python 5
BASIC TERMINOLOGIES RELATED TO COMPUTER
PROGRAMMING GITAM
Deemed to be University

SOFTWARE
 Software is a set of programs, which is designed to perform a well-
defined function. A program is a sequence of instructions written to solve
a particular problem.

There are two types of software:


• System Software
• Application Software

8/28/2020 Department of Computer Science and Engineering 19EID133 Problem Solving and Programming with Python 6
BASIC TERMINOLOGIES RELATED TO COMPUTER PROGRAMMING

SYSTEM SOFTWARE
GITAM
Deemed to be University

• The system software is collection of programs designed to operate, control, and extend the processing
capabilities of the computer itself.
• Some examples of system software are Operating System, Compilers, Interpreter, Assemblers, etc.

APPLICATION SOFTWARE
• Application software products are designed to satisfy a particular need of a particular environment.
• Examples of Application software are following:
– Payroll Software
– Student Record Software
– Inventory Management Software
– Income Tax Software
– Railways Reservation Software
– Microsoft Office Suite Software
– Microsoft Word
– Microsoft Excel
– Microsoft Powerpoint

8/28/2020 Department of Computer Science and Engineering 19EID133 Problem Solving and Programming with Python 7
BASIC TERMINOLOGIES RELATED TO COMPUTER
PROGRAMMING GITAM
Deemed to be University
• PROGRAMMING LANGUAGES
Machine Level Language(0’s and 1’s)[1940’s]
Assembly Level Language(Mnemonics)[1950’s]
High Level Languages(English like language) [1960’s]

8/28/2020 Department of Computer Science and Engineering 19EID133 Problem Solving and Programming with Python 8
BASIC TERMINOLOGIES RELATED TO COMPUTER PROGRAMMING GITAM
Deemed to be University

Programming languages :
can be used to create computer programs. A programming language is a vocabulary and set of
grammatical rules (syntax) for instructing a computer to perform specific tasks.
Programming Approaches can be:
Top Down Design
Bottom up design

8/28/2020 Department of Computer Science and Engineering 19EID133 Problem Solving and Programming with Python 9
INTRODUCTION TO PROBLEM SOLVING

GITAM
Deemed to be University
What is a Problem????
• A State of difficulty that needs to be resolved
• PROBLEMS EXISTS WHERE GOALS NEED TO BE ATTAINED
AND THERE IS UNCERTAINITY ABOUT SOLUTION

Problems Faced in Everyday life


Examples:
• Should I attend the online class or not?
• What dress and shoes to wear?
• Should I Play or study?
Everything needs a DECISION AS A SOLUTION TO THE PROBLEM.
8/28/2020 Department of Computer Science and Engineering 19EID133 Problem Solving and Programming with Python 10
INTRODUCTION TO PROBLEM SOLVING

What is Problem Solving?


 The act of finding a solution to perplexing or unsettled questions.
GITAM
Deemed to be University
 Problem Solving is the process of transforming the description of a problem into the solution of that problem
by using our knowledge on the problem domain and by relying on our ability to select and use appropriate
problem solving strategies,techniques and Tools.

 Problem solving begins with the precise identification of the problem and ends with a complete working
solution in terms of a program or software.

Problems can be of two types:


 Well-Defined Problem: will have a clear starting and end point. Example Algebra problems, geometry proofs
etc.

 ILL-Posed Problem: does not have a clear starting and end point. It is ambiguous(not clear).Example : How I
can be Happy and be prosperous?

8/28/2020 Department of Computer Science and Engineering 19EID133 Problem Solving and Programming with Python 11
INTRODUCTION TO PROBLEM SOLVING
GITAM
STEPS for PROBLEM SOLVING USING COMPUTERS: Example compute average of Deemed to be University
2 numbers
 Identify the Problem(Problem Definition clear)
 Analyze the problem
 Develop An algorithm
 Draw the Flowchart
 Program Coding
 Program Testing and Debugging
 Documentation

8/28/2020 Department of Computer Science and Engineering 19EID133 Problem Solving and Programming with Python 12
INTRODUCTION TO PROBLEM SOLVING

STEPS for PROBLEM SOLVING USING COMPUTERS: Example average of 3 numbers


GITAM
Deemed to be University
• Identify the Problem(Problem Definition clear):What problem needs to be solved, rather than
how to solve?
Understand the problem
You are appearing for some examination and you are not able to understand the question.
Can you find a solution without understanding the question??--- NO.
Precise/clear definition
What input data/information is available ?
What does it represent ?
What format is it in ? Is anything missing ? Do I have everything that I need ? What output
information am I trying to produce ? What do I want the result to look like … text, a picture, a
graph … ? What am I going to have to compute ?

8/28/2020 Department of Computer Science and Engineering 19EID133 Problem Solving and Programming with Python 13
INTRODUCTION TO PROBLEM SOLVING
GITAM
• Analyze the Problem: Why is the problem occurring? It is all about Deemed to be University
figuring out
how you will make use of the available data to compute an answer.
A complete and consistent specification(precise and unambiguous)
constraints on inputs
desired properties of outputs

8/28/2020 Department of Computer Science and Engineering 19EID133 Problem Solving and Programming with Python 14
• Develop an Algorithm:
INTRODUCTION TO PROBLEM SOLVING
GITAM
Deemed to be University
– Algorithm is blueprint or a plan for computer program.
– It is a step by step procedure to solve a particular problem in a finite number of steps, irrespective of programming language.

Essential features of algorithm are:


– Definiteness: each step must be defined precisely and clearly.
– Should lead to a unique solution
– steps/instructions must be ordered
– input can be zero or known quantity
– At least one output quantity
– Finiteness:it should terminate in finite number of steps

While writing the algorithm , we need to identify:


input---Processing or computation----output desired

Algorithm can be analyzed with a well written recipe for a dish

8/28/2020 Department of Computer Science and Engineering 19EID133 Problem Solving and Programming with Python 15
INTRODUCTION TO PROBLEM SOLVING
GITAM
• Draw the Flowchart: It is a pictorial or diagrammatic representation
Deemed to be University
of
the algorithm.
• Program Coding: converting the algorithm into a format for the
computer to understand. That is select a high level language(C+
+,Java,Python) and convert the algorithm to instructions that computer
understands.
• Program Testing and Debugging: Execute and find errors(compilation
errors, run time errors, logical errors).
• Documentation: for later debugging, testing, maintenance, redesign
purpose.
8/28/2020 Department of Computer Science and Engineering 19EID133 Problem Solving and Programming with Python 16
INTRODUCTION TO PROBLEM SOLVING
GITAM
Deemed to be University

8/28/2020 Department of Computer Science and Engineering 19EID133 Problem Solving and Programming with Python 17
GITAM
19EID133: PROBLEM SOLVING AND PROGRAMMING WITH PYTHON

SYLLABUS Deemed to be University

This course focuses on problem solving using visual programming and flowchart tools. Python being simple
and easy to learn syntax, it is used as an introductory coding platform to translate flow charts into programs.
The course introduces fundamental programming concepts. Python language is used to present concepts
including control structures, functions, data structures followed by important Python packages that will be
useful in data analysis.
• Course Objectives:
 To introduce programming through Visual programming tool - Scratch
 To teach problem solving through Flow charting tool - Raptor
 To elucidate problem solving through python programming language
 To introduce function-oriented programming paradigm through python
 To train in development of solutions using modular concepts
 To teach practical Pythonic solution patterns

8/28/2020 Department of Computer Science and Engineering 19EID133 Problem Solving and Programming with Python 18
19EID133: PROBLEM SOLVING AND PROGRAMMING WITH PYTHON
SYLLABUS L T P C
3 1 3 5.5
Unit I: Computational Thinking and Visual Programming Concepts 10 L+6P
GITAM
Deemed to be University
Introduction to computational thinking. Visual programming concepts. Scratch environment: sprites -- appearance and motion,
angles and directions, repetition and variation, changing costumes, adding background. Input/Output, variables and operators.

Unit II: Algorithms and Flowchart design through Raptor 10 L+6P


Introduction to the idea of an algorithm. Pseudo code and Flow charts. Flow chart symbols, Input/Output, Assignment, operators,
conditional if, repetition, procedure and sub charts.
Example problems – Finding maximum of 3 numbers, Unit converters, Interest calculators, multiplication tables, GCD of 2 numbers
Example problems -- Fibonacci number generation, prime number generation. Minimum, Maximum and average of n numbers,
Linear search, Binary Search.

Unit III: Introduction to Python 10 L+6P


Python – Numbers, Strings, Variables, operators, expressions, statements, String operations, Math function calls, Input/Output
statements, Conditional If, while and for loops, User defined Functions, parameters to functions, recursive functions, Turtle
Graphics.

Unit IV: Data Structures and Idiomatic Programming in Python 10 L+6P


Lists, Tuples, Dictionaries, Strings, Files and their libraries. Beautiful Idiomatic approach to solve programming problems
8/28/2020 Department of Computer Science and Engineering 19EID133 Problem Solving and Programming with Python 19
19EID133:PROBLEM SOLVING AND PROGRAMMING WITH PYTHON

Unit V : Packages 10 L+6P


GITAM
Deemed to be University
Numpy -- Create, reshape, slicing, operations such as min, max, sum , search, sort, math functions etc.
Pandas -- Read/write from csv, excel, json files, add/ drop columns/rows, aggregations, applying functions
Matplotlib -- Visualizing data with different plots, use of subplots.
User defined packages, define test cases and perform unit testing
Course outcomes:
After the completion of the course, the student will be able to
• create interactive visual programs using Scratch. (L3)
• develop flowcharts using raptor to solve the given problems. (L3)
• build Python programs for numerical and text based problems (L3)
• develop graphics and event based programming using Python (L3)
• build Python programs using beautiful Pythonic idiomatic practices (L3)
Text Book(s):
1. Weingart, Dr. Troy, Brown, Dr. Wayne, An introduction to programming and algorithmic reasoning using raptor.
2. T R Padmanabhan, Programming with python, Springer.
3. Reema Thareja, Python Programming: Using Problem Solving Approach, Oxford University Press.
4. Wes McKinney , Python for Data Analysis, O.Reilly.

8/28/2020 Department of Computer Science and Engineering 19EID133 Problem Solving and Programming with Python 20
ALGORITHM GITAM
Deemed to be University
KEY FEATURES OF AN ALGORITHM
Algorithms show the following three features:
• Sequence (also known as process)
• Decision (also known as selection)
• Repetition (also known as iteration or looping)

Developing Algorithms:
• Each algorithm enclosed between statements START and STOP.
• To accept data from user ,the INPUT or READ statements are to be used.
• To display any user message, PRINT statement will be used. Message will be enclosed with in
quotes.
• In expressions, arithmetic ,logical, relational operators can be used.

8/28/2020 Department of Computer Science and Engineering 19EID133 Problem Solving and Programming with Python 21
ALGORITHM GITAM
• Write the algorithm to find the sum of any two numbers. Deemed to be University

step 1 : START
 

step 2 : PRINT “ENTER TWO NUMBERS”

step 3 : INPUT A , B

step 4 : CßA+B

step 5 : PRINT C

step 6 : STOP

8/28/2020 Department of Computer Science and Engineering 19EID133 Problem Solving and Programming with Python 22
FLOWCHART: Graphical representation of an algorithm
Flowchart Symbols: GITAM
Deemed to be University

8/28/2020 Department of Computer Science and Engineering 19EID133 Problem Solving and Programming with Python 23
RAPTOR-flowchart-based programming environment(Rapid Algorithmic Programming Tool for Ordered Reasoning)
GITAM
Deemed to be University

• To download Raptor:
https://raptor.martincarlisle.com/
Working environment of RAPTOR is divided into four regions:
 Toolbar
 Symbol Palette
 Workspace: to create flowcharts
 watch window

8/28/2020 Department of Computer Science and Engineering 19EID133 Problem Solving and Programming with Python 24
SCRATCH GITAM
Deemed to be University

• Scratch is a free programming language and online community where


you can create your own interactive stories, games, and animations.
• Scratch is a block-based visual programming language and website
targeted primarily at children
• It provides an interactive environment to create programs by dragging
blocks of code

• https://scratch.mit.edu/download

8/28/2020 Department of Computer Science and Engineering 19EID133 Problem Solving and Programming with Python 25
Main Components of Scratch:
SCRATCH
Deemed to be University
GITAM
• Sprite: is a graphic character that performs actions in a scratch project
Scratch provides a number of inbuilt sprites. The default sprite is the cat.
• Stage: It is the main working area where the sprite moves and performs actions as per the
given instructions. Here you can watch stories, play games and run scratch projects that you
have created.
It is divided into x-y coordinates. The value of both the coordinates are displayed at the
bottom right corner of the stage

8/28/2020 Department of Computer Science and Engineering 19EID133 Problem Solving and Programming with Python 26
Flash quiz GITAM
Deemed to be University

• https://forms.gle/Lmh9mttJkgi82rgV9

8/28/2020 Department of Computer Science and Engineering 19EID133 Problem Solving and Programming with Python 27
What is Python ?
INTRODUCTION TO PYTHON
Deemed to be University
GITAM
• Python is a high level, interpreted (Install python interpreter), general purpose ,dynamic
programming language that focuses on code readability.

• It was created by Guido van Rossum in 1991 and further developed by the Python Software
Foundation, even before java which was developed (in 1995).

• Python is the fastest growing Language: ?????


• Increase in Number of developers
• Number of Libraries
• Number of Companies using Python
• Number of Area: Machine Learning, GUI, Software Web Development

8/28/2020 Department of Computer Science and Engineering 19EID133 Problem Solving and Programming with Python 28
Applications of Python
INTRODUCTION TO PYTHON GITAM
Deemed to be University

8/28/2020 Department of Computer Science and Engineering 19EID133 Problem Solving and Programming with Python 29
REFERENCES GITAM
Deemed to be University

1. Reema Thareja, Python Programming: Using Problem Solving Approach, Oxford University
Press.
2. https://ncert.nic.in/textbook/pdf/kecs104.pdf
3. https://scratch.mit.edu/
4. https://raptor.martincarlisle.com/

8/28/2020 Department of Computer Science and Engineering 19EID133 Problem Solving and Programming with Python 30
GITAM
Deemed to be University

For any clarifications/suggestions/Queries


kindly contact me through,
Mobile :7093807131(WhatsApp) / 9963146226
E-Mail : [email protected]

8/28/2020 Department of Computer


Science and Engineering 19EID133 31
Problem Solving and Programming with Python

You might also like