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

Revised Class Xi 2020-21 Introduction to Python

The document provides an introduction to Python programming, highlighting its advantages such as ease of use, object-oriented features, and cross-platform capabilities, while also noting limitations like slower performance and fewer libraries. It covers the installation process, different modes of Python (interactive and script), and the basic structure of a Python program, including expressions, statements, functions, and comments. Additionally, it discusses the role of Integrated Development Environments (IDEs) in Python programming.

Uploaded by

rnrdatatech
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Revised Class Xi 2020-21 Introduction to Python

The document provides an introduction to Python programming, highlighting its advantages such as ease of use, object-oriented features, and cross-platform capabilities, while also noting limitations like slower performance and fewer libraries. It covers the installation process, different modes of Python (interactive and script), and the basic structure of a Python program, including expressions, statements, functions, and comments. Additionally, it discusses the role of Integrated Development Environments (IDEs) in Python programming.

Uploaded by

rnrdatatech
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

Know Python Bytes

www.knowpythonbytes.blogspot.com
Mrs. Payal Bhattacharjee, PGT(C.Sc.)
K V No.1 Kanchrapara
KVS-RO(Kolkata)
CONTENTS
( Learning Outcomes ) 
Introduction to
Why Python?  Advantages of Python
Limitations of Python
About IDE
Installing Python
Modes of Python : Writing a Python Program
Getting Familiarized with the structure of a Python
Program (BAREBONES OF A PYTHON PROGRAM)
INTRODUCTION TO PYTHON
PROGRAMMING LANGUAGE
 Python is an interesting, general purpose, high-level, interpreted
programming language
 It is developed by Guido Van Rossum in February 1991.
 It is an easy to learn, playful language with powerful and
distinctive object oriented language (OOP) features.
 Python is a case-sensitive language (Uppercase and Lowercase
letters are treated differently)
 Python has its close connections with two programming languages:
 ABC Language (which replaced BASIC)
Modula-3
Python was named after famous BBC Comedy Show namely
Monty Python’s Flying Circus.
Why Python?
ADVANTAGES OF PYTHON
 Compact and very easy to use language
 Simple syntax rules( programmer friendly)
 Object Oriented language (OOP)
 High level Interpreted language
 Free and Open Source Language
 Complete and expressive language
 Cross-platform language
 Diverse language with wide applications
 Software development, Data warehousing & Mining
 Web development (server-side)  Scientific Computing,
 Data Analysis  Mathematical Applications
 Data Science  Artificial Intelligence, Robotics
LIMITATIONS of Python
 Slower than many languages
(Python programs are first semi-compiled and then interpreted
which makes it slower. But, it has faster development times due to
lesser syntax writing)
 Lesser libraries than other programming languages
(Python has less library support than others)
 Weak in Data Type-Binding
(a variable can be declared using multiple data types which is a
Type-mismatch situation))
 Not easily convertible
(tough to convert from Python to other programming languages
like C++ as others have a strong syntax)
About IDE (Integrated Development
Environment)
What Are IDEs and Code Editors? Python
An IDE (or Integrated Interpreters
Development Environment) is a
program dedicated to software Python Charm IDE
development. As the name implies, Anaconda
IDEs integrate several tools specifically Distribution for
designed for software development. Python IDE
These tools usually include: CPython.
• An editor designed to handle code IronPython.
(with, for example, syntax highlighting Jython.
and auto-completion)
PyPy.
• Build, execution, and debugging tools
PythonNet.
• Some form of source control
Stackless Python.
INSTALLING PYTHON
https://www.python.org/downloads/
1. Open 2. Click here on the setup file
(.exe) of Python
DOWNLOADS of
your computer

3. Check
this box and
select 4. Click here on
“ADD
INSTALL NOW
PYTHON3.8
TO PATH”
SET UP will prompt
you to choose
…whether you
want to INSTALL or
not.
YES/NO
5. Installing
Choose YES

6. Set up successful
7. CLICK START BUTTON and open Python 3.8 (IDLE)

8. Python prompt (Python Interpeter) .


Here, you can write your code.
Pyroid for MOBILE- to run python
codes
MODES of PYTHON
Introduction to Python
Why Python?: There are two distinct modes of Python:
Advantages
Limitations of Python I. INTERACTIVE MODE
Installing Python

Modes of Python
Getting familiarized II.SCRIPT MODE
with elements of Python
MODES of PYTHON

I. INTERACTIVE MODE
Write your code here in the interactive mode

Python Interpreter prompt denoted by >>>


MODES of PYTHON

II. SCRIPT MODE


Write your code here in the UNTITLED
file open for you (Programmer).
MODES of PYTHON
OUTPUT
STRUCTURE OF A PROGRAM IN PYTHON
Reusable
code
Importing
Libraries

Function COMMENTS
Definition (non
executable
codes)

Expression

Statements

Main
Expression
Program
Indentation Expression
(Indented
Block of
code)
(COMPONENTS/ STRUCTURE/
BAREBONES) OF A PYTHON PROGRAM
 EXPRESSIONS: Any legal combination of symbols that represent a
value.
 STATEMENTS: Any programming instruction that does some work or
some action that takes place.
 FUNCTIONS: A code that can be executed again and again (can be
reused) by calling with the name of the function
wherever needed in the program.
 BLOCKS AND INDENTATIONS: A group of statements which are part
of another statement or a function are called block or
code-block. Indentation (spaces/gaps )in front of the
statements create block. The statements under the
same block must be indented at the same level of
indentation. Indentation without reason in a statement
raises error in a program.
 COMMENTS: Please turn over to the next page to know comments in details
Comments
 Comments are the non-executable statements which are ignored by the language compiler
or interpreter. It is read by the programmers and given by them for the convenience of the
programmer.
 Comments are the additional readable information which are given for the understanding
of the user and gives information about the source code.
Comments are of two types:
1) SINGLE LINE COMMENT 2) MULTILINE COMMENT

Comments enclosed in triple (""") or triple apostrophe(' ' ') are called docstrings.
We can use either triple-apostrophe ar triple quotes(""") to write docstrings.
Stay safe. Stay aware. Stay healthy. Stay alert.

You might also like