Getting started with
python
By: Aryan kumar
Chapter :3
What is python
Python is a high-level, interpreted,
general-purpose programming
language. It is widely used for its
simplicity, readability, and
versatility in different domains like
web development, data analysis,
machine learning, automation, game
development, and more.
Steps for problem solving
There are a number of problems in
our day to day life , sach as creating
marksheet or calculating simple
intrest and all problems require
proper solving mechanism
steps
What is testing
Testing means checking your
program to see if it works as
expected for all kinds of inputs,
including normal and extreme cases.
Debugging
Debugging is the process of finding
and fixing errors (bugs) in your
program.
algrorithm
An algorithm is a step-by-step procedure or a
set of rules designed to perform a task or solve a
specific problem.
example
Characteristics of a good
algorithms
Well define inputs
Well define outpus
Clear and unambiguous
finite
feasible
Language independent
1 Precise (Well-defined Inputs and Outputs): The steps
are precisely stated or defined.
2. Unique (Clear and Unambiguous): Results of each
step are well-defined and only depend on the inputs
and the result of the preceding steps.
3. Finite: The algorithm always stops after a finite
number of steps.
4. Inputs: The algorithm receives some inputs.
5. Outputs: The algorithm produces some outputs.
6. Feasible: The algorithm should be practically
feasible to be implemented in terms of designing and
coding specifications.
7. Language-Independent: An algorithm is
independent of any programming language and
platform. It should define the prerequisite
specifications for programming to solve a given task.
Flow chart visual representation of
an algrothim
How to make flow chart
Step 1: Know the purpose of your
flowchart.
Step 2: Start with a template.
Step 3: Add shapes and symbols.
Step 4: Connect your shapes with lines
and arrows.
Step 5: Split paths or add decisions.
Step 6: Customize the appearance of your
flowchart.
Step 7: Download or share your flowchart.
example
Example 2
pseudocode
What is Pseudocode?
Pseudocode is a simplified,
informal way of writing the steps of
an algorithm using plain language
mixed with programming-like
structure.
It is not a real programming
language — it helps you plan the
logic before coding.
Key points
example
Q Write a pseudocode that reads marks of
10 students and displays the average of
marks.
Ans :- Set total to zero
Set marks counter to one
If marks counter is less than or equal to 10
Then input next marks
Add marks into the total
Set the average by dividing total by 10.
Display the average
decomposition
Decomposition is the process of
breaking down a complex
problem or system into smaller,
more manageable parts (sub-
problems).
Problem data
set
Task 0 task 1 task 2 task 3
example
When we give someone directions to
our house, we are decomposing the
process of getting from one place to
another (eg., city, state, etc.).
When we break a course project into
several steps, we are decomposing
the task into smaller more
manageable sub-tasks.
Advantages of python
1. Easy to Learn and Use
Simple and readable syntax (like English).
Ideal for beginners and non-programmers.
2. Interpreted Language
Python code runs line-by-line, making debugging easier.
No need to compile before running.
3. Cross-Platform
Works on Windows, Mac, Linux, etc., without modification.
4. Large Standard Library
Includes modules for math, file handling, web development, etc.
Saves time and effort.
5. Supports Multiple Programming Paradigms
Procedural, Object-Oriented, and Functional programming are all
supported.
6. Strong Community Support
Millions of users contribute tutorials, forums, and open-source libraries.
7. Used in Diverse Fields
Web Development (e.g., Django, Flask)
Data Science (e.g., NumPy, Pandas)
Machine Learning (e.g., TensorFlow, Scikit-learn)
Automation/Scripting, Game Development, and more.
Limitation of python
Slower than Compiled Languages
Python is interpreted, not compiled, so it runs slower than
C/C++
High Memory Usage
Not ideal for memory-intensive tasks
Weak in Mobile Development
Rarely used for mobile apps due to performance limitations
Runtime Errors
More errors can appear at runtime due to dynamic typing
Database Access is Not as Strong
Slower and less robust for heavy database applications
compared to languages like Java
Global Interpreter Lock (GIL)
Limits performance in multi-threaded applications