You are on page 1of 17

Lecture-01: Introduction To Python and Problem Solving Skill

Associate Prof. Nur Alam MD, Ph.D.


Head of Smart Computing
Kyungdong University Global
Content
① History of Python
② Simple View of Running a Program
③ Running of a Python Program
④ What is Python IDLE
⑤ Basic Concepts of Programming Language
⑥ Introduction to Python
⑦ What are the Popular Programming Language
⑧ Why did you decide to use Python as the programming
language?
⑨ Basic Concepts of Problem Solving Approach
⑩ Basic Concepts of Programming Development Life Cycle
History of Python
Python is a widely-used, interpreted, object-oriented, and high-level
programming language with dynamic semantics, used for general-
purpose programming.
It was created by Guido van Rossum, and first released on February 20,
1991.

Python goals
In 1999, Guido van Rossum defined his goals for Python:

① an easy and inspiration language just as powerful as those of the


major competitors;
② open source, so anyone can contribute to its development;
③ code that is as understandable as plain English or natural language;
④ suitable for everyday tasks, allowing for short development times.
Python’s Kindly Dictator For Life

“Python is an experiment in how much


freedom programmers need. Too much
freedom and nobody can read another’s
code; too little and expressiveness is
endangered.”

- Guido van Rossum


Simple View of Running of a Program (All PL)

Information Processing
Running Python
➢ Typical Python implementations offer both an interpreter and
compiler

➢ Before we start Python programming, we need to have an interpreter to interpret


and run our programs.

➢ Windows: There are many interpreters available freely to run Python


scripts like IDLE (Integrated Development Environment) that comes
bundled with the Python software downloaded from
http://python.org

➢ Linux: Python comes preinstalled with popular Linux OS


such as Ubuntu and Fedora.

➢ macOS: Generally, Python 2.7 comes bundled with macOS.


What is Python IDLE
Every Python installation comes with an Integrated Development and Learning Environment (IDLE),
which you’ll see shortened to IDLE or even IDE. These are a class of applications that help you write code
more efficiently.

IDLE has the following features:

① coded in 100% pure Python, using the Tkinter GUI toolkit

② cross-platform: works mostly the same on Windows, Unix, and macOS

③ Python shell window (interactive interpreter) with colorizing of code input, output, and error messages

④ multi-window text editor with multiple undo, Python colorizing, smart indent, call tips, auto-
completion, and other features

⑤ search within any window, replace within editor windows and search through multiple files (grep)

⑥ debugger with persistent breakpoints, stepping, and viewing of global and local namespaces

⑦ configuration, browsers, and other dialogs


Concepts of Programming Language
Each and every programming language has mainly three parts, such as:
(i) Flowchart, (ii) Algorithm, (iii) Coding

Flowchart
A flowchart is a graphical representation of the operations involved in a data processing system.
❖ Symbols are used to represent particular operations or data.
❖ Flow lines indicate the sequence of operations (Top to down sequence).
Oval

parallelogram
Rectangle

Dimond
Problem(1): Find the total of two numbers
(ii) Algorithm
Writing a logical step-by-step method to solve the problem is called the Algorithm. In other words, an
algorithm is a procedure for solving problems. In order to solve a mathematical or computer problem,
this is the first step in the process.

Difference between Algorithm and Flowchart

SL Algorithm Flowchart
1 It is a procedure for solving problems. [Definition] It is a graphic representation of a process. [Definition]

2 The process is shown in step-by-step instruction. The process is shown in block-by-block information
diagram.
3 It is complex and difficult to understand. It is intuitive and easy to understand.

4 It is convenient to debug errors. It is hard to debug errors.


5 The solution is showcased in natural language. The solution is showcased in pictorial format.

6 It is somewhat easier to solve complex problem. It is hard to solve complex problem.

7 It costs more time to create an algorithm. It costs less time to create a flowchart.
(iii) Coding
Coding is basically the computer language used to develop apps, websites, and software. Without it,
we’d have none of the most popular technology we’ve come to rely on such as facebook, our
smartphones, the browser we choose to view our favorite blogs, or even the blogs themselves. It all runs
on code.

What are the Popular Coding Languages

Since the 1970s, computer experts have created more than 700 different programming languages. Each
language has a unique way of helping computers process huge amounts of information. Every coding
language has different features and terms with some overlap. New coders shouldn’t be something by
the plethora of programming types though. There are only about a dozen programming languages that
are commonly used. These include C, C++, C#, Java, Python, Ruby, Swift, PHP, HTML, SQL, Cobol,
Visual Basic, Scripting and Perl, etc. Let’s look at some of the major coding languages about which
beginners should know. # This program adds two numbers
num1 = 1.5
Example of coding in Python num2 = 6.3
# Add two numbers
sum = num1 + num2
# Display the sum
print('The sum of {0} and {1} is {2}'.format(num1, num2, sum))
Why did you decide to use Python as the programming language? (1)
Many people consider Python to be
the best language to teach Adding Program in C++
beginners how to program.

We agree. Also, Python is being


used by major software companies.
① Python is powerful,
② easy to write and read,
③ easy to download and install,
④ and it runs under Windows,
Mac, and Linux operating
systems. Adding Program in C#
Why did you decide to use Python as the programming language? (2)
Adding Program in Java Adding Program in Ruby

Adding Program in Python (1)


Basic Concepts of Problem Solving Approach
This problem-solving approach is the same as that used to solve word problems in an algebra class. For
example, consider the following algebra problem: How fast is a car moving if it travels 50 miles in 2
hours?
① The first step is to determine the type of answer requested.
② The answer should be a number giving the speed in miles per hour (the output).
③ The information needed to obtain the answer is the distance and time the car has traveled (the
input).

The formula,
speed = distance/time

is used to process the distance traveled and the time passed away in order to determine the speed. That
is,
speed = 50 miles/2 hours
= 25 miles per hour
Basic Concepts of Programming Development Life Cycle [PDLC]
Many programmers plan their programs using a sequence of steps, referred to as the Software
Development Life Cycle. Programmer are use commonly 5 following step-by-step process will solve
there problem. The following steps are given below:
(1) Analyze: Define the problem.
Be sure you understand what the program should do—that is, what the output should be. Have a clear
idea of what data (or input) are given and the relationship between the input and the desired output.
(2) Design: Plan the solution to the problem.
Find a logical sequence of precise steps that solve the problem. Such a sequence of steps is called an
algorithm or Flowchart.
(3) Code: Translate the algorithm into a programming language.
Coding is the technical word for writing the program. Programmer will decided which programming
they will select based on problem domain.
(4) Test and Correct: Locate and remove any errors in the program.
Testing is the process of finding errors in a program. (An error in a program is called a bug and testing
and correcting is often referred to as debugging.)
(5) Complete the Documentation: Organize all the material that describes the program.
Documentation is intended to allow another person, or the programmer at a later date, to understand
the program.
Assignment-01 [Due Date: 2022.09.18 @ 11.50 PM]

1. What does the central processing unit (CPU) do?


2.What is difference between interpreter and
compiler?
3. What is Python IDLE?
4. How to solved problems?
5. What are the main features of Python?
Contact Information

Do You Have Any Question?

Thank You!!!
na@kduniv.ac.kr // uzzalnp@gmail.com
https://sites.google.com/view/nur-alam-md/home
https://www.facebook.com/nur.alam.9674227
010-3191-5031 / 033-639-0167
bsc.kdu.global@gmail.com
Artificial Intelligence and Computer Vision Lab

You might also like