0% found this document useful (0 votes)
42 views

CH 1 Introduction To Python

This document provides an introduction to Python programming. It discusses strategies for solving problems using algorithms and flowcharts. It also covers key features of the Python language like being interpreted, platform independent, and having a simple syntax. The document explains how to install Python on Windows and MacOS. It describes Python interpreters and compilers, and introduces integrated development environments like PyCharm and Jupyter Notebook for writing Python code.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views

CH 1 Introduction To Python

This document provides an introduction to Python programming. It discusses strategies for solving problems using algorithms and flowcharts. It also covers key features of the Python language like being interpreted, platform independent, and having a simple syntax. The document explains how to install Python on Windows and MacOS. It describes Python interpreters and compilers, and introduces integrated development environments like PyCharm and Jupyter Notebook for writing Python code.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 15

Introduction to Python

F.Y.B.Sc- Economics
Symbiosis School of Economics, Pune
Content

 Strategies to solve problems,


 Algorithm & flow chart
 Features of Python Interpretation &
 compilation Python Editor-IDE, Pycharm & Jupyter Noteboo
Strategies to solve problems

 What is a Problem?
 PROBLEM SOLVING
 Problem solving is the systematic approach to define the problem and creating number of
solutions.
 The problem solving process starts with the problem specifications and ends with a correct
program.
Algorithm & flow chart

ALGORITHM
 It is defined as a sequence of instructions that describe a method for solving a problem.
 In other words it is a step by step procedure for solving a problem
 Should be written in simple English
 Each and every instruction should be precise and unambiguous.
 Instructions in an algorithm should not be repeated infinitely.
 Algorithm should conclude after a finite number of steps.
 Should have an end point
 Derived results should be obtained only after the algorithm terminates.
Building Blocks of Algorithm

As algorithm is a part of the blue-print or plan for the computer program. An algorithm is constructed using
following blocks.
 Statements
 States
 Control flow
 Function
 Statements
 Statements are simple sentences written in algorithm for specific purpose. Statements may consists of
assignment statements, input/output statements, comment statements
 Eg.Read the value of ‘a’ //This is input statement
 Calculate c=a+b //This is assignment statement
 Print the value of c // This is output statement
Algorithm for addition of two numbers using
function
 Main function()
 Step 1: Start
 Step 2:Call the function add()
 Step 3: Stop
 sub function add()
 Step1:Functionstart
 Step2:Geta,bValues Step 3: add c=a+b Step 4: Print c
 Step 5: Return
Flowchart
 A graphical representation
of an algorithm. Flowcharts is a diagram made up of boxes, diamonds, and other shapes, connected by arrows.
 Each shape represents a step in process and arrows show the order in which they occur.
S.No Name of Symbol Type Description
symbol
1. Terminal Oval Represent the start and
Symbol stop of the program.

2. Input/ Output Parallelogram Denotes either input or


symbol output operation.

3. Process symbol Rectangle Denotes the process to be


carried

4. Decision symbol Diamond Represents decision


making and branching

5. Flow lines Arrow lines Represents the sequence


of steps and direction of
flow. Used to connect
symbols.

6. Connector Circle A connector symbol is


represented by a circle and
a letter or digit is placed in
the circle to specify the
link. This symbol is
used to
connect flowcharts.
Example 1
Example 2
Programming Language

 A programming language is a vocabulary and set of grammatical rules for instructing a


computer or computing device to perform specific tasks. In other word it is set of
instructions for the computer to solve the problem.
 Programming Language is a formal language with set of instruction, to the computer to sol
ve a problem. The program will accept the data to perform computation.
 Program= Algorithm +Data
 Types of Programming Language
 In general Programming languages are classified into three types. They are
 Low – level or Machine Language
 Intermediate or Assembly Language
 High – level Programming language
Introduction to Python

 Python is an easy to learn, powerful programming language. It has efficient high-level data
structures and a simple but effective approach to object-oriented programming. Python’s
elegant syntax and dynamic typing, together with its interpreted nature, make it an ideal
language for scripting and rapid application development in many areas on most platforms.
 Python is a widely used general-purpose, high level programming language. It was created
by Guido van Rossum in 1991 and further developed by the Python Software Foundation.
It was designed with an emphasis on code readability, and its syntax allows programmers
to express their concepts in fewer lines of code.
Features of Python

LANGUAGE FEATURES
 Interpreted
 Platform Independent
 Free and Open Source
 High-level Language
 Simple
 Embeddable
 Robust:
 Rich Library Support
Installation

 https://www.anaconda.com/download
 Steps to Install Python on Windows 10
 Here we are providing the installation process of Python 3.11.2 on Windows
 Run the Python Installer for how to install Python on the Windows downloads folder
 Make sure to mark Add Python 3.11 to PATH otherwise you will have to do it explicitly. It will start
installing Python on Windows.
Install Python on MacOS
 To install Python simply open the Terminal app from Application -> Utilities and enter the following command
 brew install python3
 To verify the installation enter the following commands in your Terminal app

 python
 pip3
Python Interpretation & compilation Python
Editor-IDE, Pycharm & Jupyter Notebook
 Python is an interpreted language, which means the source code of a Python program is
converted into bytecode that is then executed by the Python virtual machine.
 python program is first compiled and then interpreted. The compilation part is hidden from
the programmer thus, many programmers believe that it is an interpreted language. The
compilation part is done first when we execute our code and this will generate byte code
and internally this byte code gets converted by the python virtual machine(p.v.m)
according to the underlying platform(machine+operating system).
 Practical Session
Thank You

You might also like