0% found this document useful (0 votes)
16 views23 pages

Getting Started With Python

INTRODUCTION TO PYTHON

Uploaded by

trivenya0523
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
Download as pptx, pdf, or txt
0% found this document useful (0 votes)
16 views23 pages

Getting Started With Python

INTRODUCTION TO PYTHON

Uploaded by

trivenya0523
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1/ 23

Getting Started with Python

Class 11
Introduction

 Python is a high-level, object-oriented programming
language.
 Python is frequently considered as one of the simplest
programming languages to learn for beginners.
 Python’s simple syntax prioritizes readability and makes
it simple to learn, which lowers the cost of programme
maintenance.
 Python’s support for modules and packages promotes
the modularity and reuse of code in programmes.
 For all popular platforms, the Python interpreter and the
comprehensive standard library are freely distributable
and available in source or binary form.
History

Features of Python

 Python is a high-level language. It is a free and open-source
language.
 It is an interpreted language, as Python programs are executed by
an interpreter.
 Python programs are easy to understand as they have a clearly
defined syntax and relatively simple structure.
 Python is case-sensitive. For example, NUMBER and number are
not same in Python.
 Python is portable and platform independent, means it can run on
various operating systems and hardware platforms.
 Python has a rich library of predefined functions.
 Python is also helpful in web development. Many popular web
services and applications are built using Python.
 Python uses indentation for blocks and nested blocks.
Applications of
Python

 Python is a high-level, general-purpose programming
language. It is different from other languages such as C
and Java that are designed to be compiled to machine
code. Python is easy to learn and can be used to write
virtually anything that can be described in code.
 There are different type of Python Application –
 Web and Internet Development
 Desktop GUI Application
 Software Development
 Database Access
 Business Application
 Games and 3D Graphics
Installation of Python

 Python is a cross-platform programming language, which
means it runs on a variety of platforms including
Windows, MacOS or Linux operating system.
 A Python interpreter must be installed on our computer in
order to write and run Python programmes.
 Downloading and Setting up Python
 Step 1 : Download Python from python.org using link
https://www.python.org/downloads/
 Step 2 : Select appropriate download link as per Operating
System [Windows 32 Bit/64 Bit, Apple iOS]
 Step 3 : Click on Executable Installer
 Step 4 : Install
Run Executable
Installer

Run Executable
Installer

The installation process will take few minutes to
complete and once the installation is successful,
the following screen is displayed.

Python IDLE
installation

 After installing Python, you’ll need an IDE to
write Python programmes. IDLE is a Python
editor with a graphical user interface. IDLE
stands for Integrated Development
Environment. This IDLE is also known as the
Python shell, and it has two modes of
operation: interactive mode and script mode.
Interactive Mode allows us to communicate
with the operating system, whereas Script
Mode allows us to generate and edit Python
source files.
Verify Python is
installed on
 Windows
 To ensure if Python is succesfully installed on
your system. Follow the given steps −
 Open the command prompt.
 Type ‘python’ and press enter.
 The version of the python which you have
installed will be displayed if the python is
successfully installed on your windows.
Execution Modes


There are two ways to use the Python
interpreter:
a) Interactive mode
b) Script mode
 Interactive Mode
 Programmers can quickly run the
commands and try out or test code
without generating a file by using the
Python interactive mode, commonly
known as the Python interpreter or
Python shell. To work in the interactive
mode, we can simply type a Python
statement on the >>> prompt directly.
It’s practical to test one line of code for
immediate execution while working in
interactive mode.
Execution Modes

 Script Mode
 In the script mode, a Python programme can be
written in a file, saved, and then run using the
interpreter.
Python scripts are stored in files with the “.py”
extension. Python scripts are saved by default
in the Python installation folder.
Working with
Python

 We require a Python interpreter
installed on our computer or we
can utilize any online Python
interpreter in order to create and
run (execute) a Python
programme. The Python shell is
another name for the interpreter.
 The Python prompt, represented
by the symbol >>> in the
screenshot , indicates that the
interpreter is prepared to accept
commands.
Python Code
Execution

Python Keywords

 Keywords are reserved words. Each keyword
has a specific meaning to the Python
interpreter, and we can use a keyword in our
program only for the purpose for which it has
been defined. As Python is case sensitive,
keywords must be written exactly.
Identifiers

 Identifiers are names used in programming
languages to identify a variable, function, or
other things in a programme. Python has the
following guidelines for naming an identifier:
a. The name should begin with an uppercase
or a lowercase alphabet or an underscore sign
(_).
b. It can be of any length.
c. It should not be a keyword or reserved
word.
d. We cannot use special symbols like !, @, #,
$, %, etc.
Variables

 A variable’s name serves as a program’s unique
identifier (identifier). In Python, the term “variable”
refers to an object, which is a thing or things that is
kept in memory. A variable’s value can be a string,
such as “b,” or a number, such as “345,” or any
combination of alphanumeric characters (CD67). In
Python, we can create new variables and give them
particular values by using an assignment statement.
 gender = ‘M’
message = “Keep Smiling”
price = 987.9
Comments

 In the source code, comments are used to add
remarks or notes. The interpreter doesn’t
carry out comments. They are included to
make the source code simpler for individuals
to understand. comments always start from #.
 Example
#Add your python comments
Sample Programs

Sample Programs

id() Function

Thank You

You might also like