0% found this document useful (0 votes)
36 views4 pages

Python Programming for Problem Solving

This course focuses on teaching problem solving and programming concepts using Python. It introduces visual programming with Scratch and flowcharting with Raptor. The course then covers Python programming, including control structures, functions, data structures, and key Python packages like NumPy and Pandas. Students learn to develop solutions using modular concepts and apply idiomatic Python practices. The course aims to provide hands-on experience in programming through various lab experiments involving problems on data processing, graphics, and algorithms.

Uploaded by

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

Python Programming for Problem Solving

This course focuses on teaching problem solving and programming concepts using Python. It introduces visual programming with Scratch and flowcharting with Raptor. The course then covers Python programming, including control structures, functions, data structures, and key Python packages like NumPy and Pandas. Students learn to develop solutions using modular concepts and apply idiomatic Python practices. The course aims to provide hands-on experience in programming through various lab experiments involving problems on data processing, graphics, and algorithms.

Uploaded by

NAMBURUNITHIN
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Problem Solving and Programming with Python

(Common to all)

L T P A C 2 0 3 0 3.5 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 Python solution patterns

Unit I: Computational Thinking and Visual Programming Concepts

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.

Learning Outcomes

After completion of this unit the student will be able to

• develop a program, controlled by a loop. (L3)

• experiment with “costumes” to change the appearance of sprites. (L3)

• perform Input, Output Operations using scratch. (L3)

• perform computation using common mathematical formulas. (L3)

• develop programs by passing messages between sprites. (L3)

Unit II: Algorithms and Flowchart design through Raptor

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.

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

Learning outcomes:

After completion of this unit the student will be able to

• select flowchart symbols for solving problems. (L1)

• develop basic flowcharts for performing Input, Output and Computations

(L3)
• solve numerical problems using Raptor (L3)

• analyze problems by modular approach using Raptor (L4)

Unit III : Introduction to Python

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.

Learning outcomes:

After completion of this unit the student will be able to


• interpret numbers, strings, variables, operators, expressions and math

functions using Python Interactive Mode. (L2)

• solve simple problems using control structures, input and output statements.

(L3)

• develop user defined functions (recursive and non-recursive). (L3)

• build Python programs for section 1 raptor flowcharts. (L3)

• develop Python programs for creating various graphical shapes using turtle

graphics. (L3)

Unit IV : Data Structures and Idiomatic Programming in Python

Lists, Tuples, Dictionaries, Strings, Files and their libraries. Beautiful Idiomatic approach to solve programming problems.

35
Learning outcomes:

After completion of this unit the student will be able to

• summarize the features of lists, tuples, dictionaries, strings and files. (L2)

• demonstrate best practices of “Beautiful Idiomatic Python”. (L2)

• build Python programs for section 2 raptor flowcharts. (L3).

Unit V : Packages

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

Learning outcomes:
After completion of this unit the student will be able to

• read data from files of different formats and perform operations like slicing,

insert, delete, update (L3)

• visualize the data (L4)

• ability to define packages (L2)

• define test cases (L1)

Laboratory Experiments

1. Design a script in Scratch to make a sprite to draw geometrical shapes such


as Circle, Triangle, Square, Pentagon.
2. Design a script in Scratch to make a sprite to ask the user to enter two different numbers and an arithmetic operator and then calculate and
display the result.
3. Design a Memory Game in Scratch which allows the user to identify
positions of similar objects in a 3 x 3 matrix.
4. Construct flowcharts to
a. calculate the maximum, minimum and average of N numbers

b. develop a calculator to convert time, distance, area, volume and


temperature from one unit to another.
5. Construct flowcharts with separate procedures to
a. calculate simple and compound interest for various parameters
specified by the user b. calculate the greatest common divisor using iteration and recursion
for two numbers as specified by the user
6. Construct flowcharts with procedures to
a. generate first N numbers in the Fibonacci series
b. generate N Prime numbers
7. Design a flowchart to perform Linear search on list of N unsorted
numbers(Iterative and recursive) 8. Design a flowchart to perform Binary search on list of N sorted
numbers(Iterative and recursive) 9. Design a flowchart to determine the number of characters and lines in a text
file specified by the user 10. Design a Python script to convert a Binary number to Decimal number and
verify if it is a Perfect number. 11. Design a Python script to determine if a given string is a Palindrome using
recursion 12. Design a Python script to sort numbers specified in a text file using lists. 13. Design a Python script to determine the difference
in date for given two dates in YYYY:MM:DD format(0 <= YYYY <= 9999, 1 <= MM <= 12, 1 <= DD <= 31) following the leap year rules. 14.
Design a Python Script to determine the Square Root of a given number
without using inbuilt functions in Python. 15. Design a Python Script to determine the time difference between two given times in
HH:MM:SS format.( 0 <= HH <= 23, 0 <= MM <= 59, 0 <= SS <= 59) 16. Design a Python Script to find the value of (Sine, Cosine, Log, PI, e ) of a
given number using infinite series of the function. 17. Design a Python Script to convert a given number to words 18. Design a Python Script
to convert a given number to roman number. 19. Design a Python Script to generate the frequency count of words in a text
file. 20. Design a Python Script to print a spiral pattern for a 2 dimensional matrix. 21. Design a Python Script to implement Gaussian
Elimination method. 22. Design a Python script to generate statistical reports(Minimum, Maximum,
Count, Average, Sum etc) on public datasets. 23. Design a Python script using the Turtle graphics library to construct a turtle bar chart
representing the grades obtained by N students read from a file categorising them into distinction, first class, second class, third class and failed.
37
Reference Books:

[Link] introduction to programming and algorithmic reasoning using raptor, Weingart, Dr. Troy, Brown, Dr. Wayne

[Link] with python, T R Padmanabhan, Springer

[Link] Programming: Using Problem Solving Approach, Reema Thareja, Oxford University Press

[Link] for Data Analysis, Wes McKinney, [Link]

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)

38

Common questions

Powered by AI

Data structures are taught within the Python component by introducing lists, tuples, dictionaries, strings, and files. The course focuses on summarizing these structures' features and demonstrating best practices of idiomatic Python to solve programming problems effectively. Students learn through practical application and development of Python programs based on the flowcharts created with Raptor, reinforcing the understanding of these fundamental programming constructs.

The course ensures students can perform data analysis using Python packages by covering Numpy, Pandas, and Matplotlib. Students learn to manipulate data arrays and perform mathematical operations using Numpy, handle data read/write operations and execute data aggregation using Pandas, and visualize data through plots with Matplotlib. These packages are taught with a focus on practical application, enabling students to manage and analyze data from various sources in real-world scenarios.

The course employs Raptor to develop problem-solving skills by teaching flowchart design. Through the use of flowchart symbols and basic operations like Input/Output, Assignment, and conditional and iterative procedures, students learn to represent and solve algorithmic problems. Example problems, such as finding the GCD of two numbers or generating the Fibonacci series, are used to apply these concepts practically, thereby solidifying understanding through visual problem representation.

Introducing computational thinking using Scratch provides pedagogical advantages such as enhancing understanding through visual and interactive learning. It allows learners to manipulate 'sprites' and use visual elements to understand basic programming structures, such as loops and conditionals, in an intuitive manner. This interactive environment facilitates experimentation and creativity, making abstract concepts more tangible and easier to grasp for beginners, which is critical for foundational learning.

The course approaches teaching complex problems by breaking down the problems into smaller, manageable parts and teaching the necessary Python constructs to solve each. For date difference calculation, students learn input parsing, date math, and conditionals for leap year logic. For Gaussian elimination, it involves understanding linear algebra concepts and implementing matrix manipulations using loops and conditionals in Python. This approach incorporates teaching both the theoretical background and practical implementation to solve complex problems.

Turtle Graphics play the role of enhancing the learning experience by providing a visual and interactive medium for students to apply programming concepts in Python. It helps in demonstrating control structures, loops, and functions by visually drawing shapes and patterns, making abstract programming concepts more tangible. This hands-on approach aids in deepening students' understanding and retention of programming logic and syntax.

The course integrates visual programming tools such as Scratch and Raptor to aid in learning programming. Scratch is used to introduce computational thinking and visual programming concepts, allowing students to develop programs controlled by loops and to perform Input/Output operations. Raptor is used for flowchart design to illustrate algorithms, enabling students to solve problems through developing and analyzing flowcharts.

The course prepares students to solve programming problems using Beautiful Idiomatic Python by teaching them to develop Python programs that follow best practices in code readability and efficiency. The focus is on developing Python scripts and solutions using the language's idiomatic techniques, which encourage elegant and efficient coding practices. Students are exposed to practical examples and problems that require applying idiomatic principles, reinforcing their ability to write clean and maintainable code.

Building Python programs for sectioned flowcharts reinforces understanding by requiring students to translate visual flowchart logic into functional code. This process deepens comprehension of programming logic and control structures, as students must ensure their Python code mirrors the logic depicted in their flowcharts accurately. It enables students to connect abstract programming concepts with concrete problem-solving processes, promoting a deeper, more integrated understanding of programming.

Using Python facilitates understanding of programming concepts due to its simple syntax and versatility in demonstrating fundamental concepts such as control structures, data structures, and functions. Python also supports teaching through practical solution patterns and function-oriented programming paradigm, emphasizing both simple problem-solving and advanced data analysis, which helps students transition from basic to complex problem solving more seamlessly.

You might also like