SlideShare a Scribd company logo
Python Programming
UNIT 1 : SYLLABUS
• Conceptual introduction: topics in computer science, algorithms;
• Modern computer systems: hardware architecture, data
representation in computers, software and operating system;
• Installing Python; basic syntax, interactive shell, editing, saving, and
running a script.
• The concept of data types; variables, assignments; immutable
variables; numerical types;
• arithmetic operators and expressions; comments in the program;
understanding error messages;
Guido Van Rossum published the
first version of Python code
(Python 0.9.0) in February 1991.
This release included exception
handling, functions and the core
data types.
Python 1.0 released in
January 1994. It included
filters, map, reduce and
lambda
Python 2.0 released in October
2000. Features include list
comprehension and garbage
collection with reference cycles
Python 3.0 released in December
2008. Removed duplicate
constructs and modules. Not
backward compatible.
1
2
3
4
5
6
FREE AND OPEN SOURCE
The standard modules and
the Python interpreter are
free.
PORTABLE
Python interpreter exists for
almost all platforms/operating
systems.
SIMPLE & EASY TO LEARN
Python has a very simple
syntax; it means it is very
easy to learn and code.
EXTENSIVE
LIBRARIES
The Python Standard
Library is very exhaustive
library
EXTENSIBLE
&EMBEDDABLE
One can embed Python
within a C or C++
program.
OBJECT ORIENTED
Python supports object-
oriented programming
Features of
Python
Basic syntax &
Interactive shell
Editing, Saving, and
Running a script.
Installing Python
Installing Python
Installing Python
Installing Python
Installing Python
Installing Python
Installing Python
Installing Python
Installing Python
Installing Python
Basic syntax &
Interactive shell
Editing, Saving, and
Running a script.
Installing Python
Basic syntax & Interactive shell
The instructions written
in Python programming language can be
executed in two modes:
• Interactive mode
• Normal or Script mode
Interactive mode:
In this mode, lines of code is directly written and
executed in the Python interpreter shell, which
instantaneously provide the results.
Normal or Script mode:
In this mode the source code is saved to a file
with .py extension, and the file is executed
by the Python interpreter.
A shell window contains an opening message
followed by the special symbol >>>, called a shell
prompt.
Basic syntax & Interactive shell
Basic syntax & Interactive shell
Basic syntax & Interactive shell
The programmer can also display the output
of a value by using the print function.
print(<expression>)
To begin the next output on the same line as the
previous one, you can place the expression end = “
”
>>> print("Python" , end = ' ')
>>> print(“Programming")
write a print function that includes two or
more expressions separated by commas.
In such a case, the print function evaluates
the expressions and displays the results,
separated by single spaces, on one line.
print(<expression>,..., <expression>)
>>> print ("Hi there")
Hi there
>>> print(3+4,8-5,"hello")
7 3 hello
Basic syntax & Interactive shell
Programs to ask the user for input. You can
do this by using the input function.
>>> name = input("Enter your name: ")
Enter your name: RISE Group
>>> name
' RISE Group '
>>> print(name)
Ken Lambert
The input function does the following:
1. Displays a prompt for the input. In this
example, the prompt is "Enter your name: ".
2. Receives a string of keystrokes, called
characters, entered at the keyboard and
returns the string to the shell.
This function causes the program to stop and
wait for the user to enter a value from the
keyboard.
Basic syntax & Interactive shell
• The input function always builds a string
from the user’s keystrokes and returns it
to the program.
• After inputting strings that represent
numbers, the programmer must convert
them from strings to the appropriate
numeric types.
• In Python, there are two type conversion
functions for this purpose, called int (for
integers) and float (for floating point
numbers).
>>> first = int(input("Enter the first number:
"))
Enter the first number: 23
>>> second = int(input("Enter the second
number: "))
Enter the second number: 44
>>> print("The sum is", first + second)
The sum is 67
Basic syntax &
Interactive shell
Editing, Saving, and
Running a script.
Installing Python
Editing, Saving, and Running a script.
• It is more convenient to
compose, edit, and save longer,
more complex programs in
files.
• We can then run these program
files or scripts either within
IDLE or from the operating
system’s command prompt
without opening IDLE.
Perform the following steps:
1. Select the option New Window from the File
menu of the shell window.
2. In the new window, enter Python expressions or
statements on separate lines, in the order in which
you want Python to execute them.
3. At any point, you may save the file by selecting
File/Save. If you do this, you should use a . py
extension. For example, your first program file
might be named myprogram.py.
4. To run this file of code as a Python script, select
Run Module from the Run menu or press the F5 key.
Basic syntax &
Interactive shell
Editing, Saving, and
Running a script.
Installing Python
UNIT 1 : SYLLABUS
• Conceptual introduction: topics in computer science, algorithms;
• Modern computer systems: hardware architecture, data
representation in computers, software and operating system;
• Installing Python; basic syntax, interactive shell, editing, saving, and
running a script.
• The concept of data types; variables, assignments; immutable
variables; numerical types;
• arithmetic operators and expressions; comments in the program;
understanding error messages;

More Related Content

PPTX
Python Programming | JNTUK | UNIT 1 | Lecture 1 & 2
PDF
Fundamentals of programming with C++
PPT
isa architecture
PPT
Mips architecture
PPTX
Enee114 01
PDF
number system understand
ODP
Local Exploits
Python Programming | JNTUK | UNIT 1 | Lecture 1 & 2
Fundamentals of programming with C++
isa architecture
Mips architecture
Enee114 01
number system understand
Local Exploits

What's hot (20)

PPTX
Computer Architecture
PDF
Machine language
PPTX
INSTRUCTION SET
PPT
Chapt 01 Assembly Language
PDF
Fundamentals of data structures ellis horowitz & sartaj sahni
PPTX
Intro to Data Structure & Algorithms
PDF
It tools and buisness system.docx
PDF
Highlevel assemly
PPTX
Assembly Language
PDF
Assembly Langauge Chap 1
PPTX
Computer architecture
PPTX
Programming the basic computer
PPT
Computer Organization and Assembly Language
PPTX
Assembly language
PPTX
Process of algorithm evaluation
PPTX
Intro to assembly language
PDF
Systemsoftwarenotes 100929171256-phpapp02 2
PDF
Lecture 7
PPSX
Dsp Datapath
PPTX
PROGRAM LOGIC AND FORMULATION
Computer Architecture
Machine language
INSTRUCTION SET
Chapt 01 Assembly Language
Fundamentals of data structures ellis horowitz & sartaj sahni
Intro to Data Structure & Algorithms
It tools and buisness system.docx
Highlevel assemly
Assembly Language
Assembly Langauge Chap 1
Computer architecture
Programming the basic computer
Computer Organization and Assembly Language
Assembly language
Process of algorithm evaluation
Intro to assembly language
Systemsoftwarenotes 100929171256-phpapp02 2
Lecture 7
Dsp Datapath
PROGRAM LOGIC AND FORMULATION
Ad

Similar to Python Programming | JNTUK | UNIT 1 | Lecture 3 (20)

PDF
PYTHON PROGRAMMING NOTES RKREDDY.pdf
PPTX
Python fundamentals
PDF
20210517-PYTHON AI&DS PROGRAMMING NOTES.pdf
PDF
20210517-PYTHON AI&DS PROGRAMMING NOTES.pdf
PPT
Learn python
PDF
Python for Machine Learning
PPTX
UNIT-1 : 20ACS04 – PROBLEM SOLVING AND PROGRAMMING USING PYTHON
PDF
Python Programming Note for only beginers
PPTX
Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...
PPTX
Introduction to python.pptx
PDF
Fundamentals of python
PPTX
UNIT 1 PYTHON introduction and basic level
PDF
First Steps in Python Programming
PPTX
cupdf.com_python-seminar-ppt.pptx.........
PPTX
VKS-Python Basics for Beginners and advance.pptx
DOCX
Python Course.docx
PPT
Spsl iv unit final
PPT
Spsl iv unit final
PPT
python-ppt.ppt
PPT
python-ppt.ppt
PYTHON PROGRAMMING NOTES RKREDDY.pdf
Python fundamentals
20210517-PYTHON AI&DS PROGRAMMING NOTES.pdf
20210517-PYTHON AI&DS PROGRAMMING NOTES.pdf
Learn python
Python for Machine Learning
UNIT-1 : 20ACS04 – PROBLEM SOLVING AND PROGRAMMING USING PYTHON
Python Programming Note for only beginers
Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...
Introduction to python.pptx
Fundamentals of python
UNIT 1 PYTHON introduction and basic level
First Steps in Python Programming
cupdf.com_python-seminar-ppt.pptx.........
VKS-Python Basics for Beginners and advance.pptx
Python Course.docx
Spsl iv unit final
Spsl iv unit final
python-ppt.ppt
python-ppt.ppt
Ad

More from FabMinds (20)

PPTX
Python Programming | JNTUA | UNIT 3 | Lists |
PPTX
Python Programming | JNTUA | UNIT 3 | Strings |
PPTX
Python Programming | JNTUA | UNIT 3 | Updating Variables & Iteration |
PPTX
Python Programming | JNTUA | UNIT 2 | Case Study |
PPTX
Python Programming | JNTUA | UNIT 2 | Fruitful Functions |
PPTX
Python Programming | JNTUA | UNIT 2 | Conditionals and Recursion |
PPTX
Application layer protocols
PPTX
Internet connectivity
PPTX
Introduction for internet connectivity (IoT)
PPTX
web connectivity in IoT
PPTX
message communication protocols in IoT
PPTX
web communication protocols in IoT
PPTX
introduction for web connectivity (IoT)
PPTX
Python Introduction | JNTUA | R19 | UNIT 1 | Functions
PPTX
Python Introduction | JNTUA | R19 | UNIT 1 | Functions
PPTX
Python Programming | JNTUK | UNIT 2 | Lecture 6 & 7 | Conditional & Control S...
PPTX
Data enrichment
PPTX
Communication technologies
PPTX
M2M systems layers and designs standardizations
PPTX
Business models for business processes on IoT
Python Programming | JNTUA | UNIT 3 | Lists |
Python Programming | JNTUA | UNIT 3 | Strings |
Python Programming | JNTUA | UNIT 3 | Updating Variables & Iteration |
Python Programming | JNTUA | UNIT 2 | Case Study |
Python Programming | JNTUA | UNIT 2 | Fruitful Functions |
Python Programming | JNTUA | UNIT 2 | Conditionals and Recursion |
Application layer protocols
Internet connectivity
Introduction for internet connectivity (IoT)
web connectivity in IoT
message communication protocols in IoT
web communication protocols in IoT
introduction for web connectivity (IoT)
Python Introduction | JNTUA | R19 | UNIT 1 | Functions
Python Introduction | JNTUA | R19 | UNIT 1 | Functions
Python Programming | JNTUK | UNIT 2 | Lecture 6 & 7 | Conditional & Control S...
Data enrichment
Communication technologies
M2M systems layers and designs standardizations
Business models for business processes on IoT

Recently uploaded (20)

PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PPTX
Week 4 Term 3 Study Techniques revisited.pptx
PDF
Basic Mud Logging Guide for educational purpose
PDF
Complications of Minimal Access Surgery at WLH
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
Business Ethics Teaching Materials for college
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
O7-L3 Supply Chain Operations - ICLT Program
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
Classroom Observation Tools for Teachers
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PDF
Anesthesia in Laparoscopic Surgery in India
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Week 4 Term 3 Study Techniques revisited.pptx
Basic Mud Logging Guide for educational purpose
Complications of Minimal Access Surgery at WLH
PPH.pptx obstetrics and gynecology in nursing
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Business Ethics Teaching Materials for college
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
O7-L3 Supply Chain Operations - ICLT Program
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Classroom Observation Tools for Teachers
human mycosis Human fungal infections are called human mycosis..pptx
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Final Presentation General Medicine 03-08-2024.pptx
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
VCE English Exam - Section C Student Revision Booklet
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
Anesthesia in Laparoscopic Surgery in India

Python Programming | JNTUK | UNIT 1 | Lecture 3

  • 2. UNIT 1 : SYLLABUS • Conceptual introduction: topics in computer science, algorithms; • Modern computer systems: hardware architecture, data representation in computers, software and operating system; • Installing Python; basic syntax, interactive shell, editing, saving, and running a script. • The concept of data types; variables, assignments; immutable variables; numerical types; • arithmetic operators and expressions; comments in the program; understanding error messages;
  • 3. Guido Van Rossum published the first version of Python code (Python 0.9.0) in February 1991. This release included exception handling, functions and the core data types. Python 1.0 released in January 1994. It included filters, map, reduce and lambda Python 2.0 released in October 2000. Features include list comprehension and garbage collection with reference cycles
  • 4. Python 3.0 released in December 2008. Removed duplicate constructs and modules. Not backward compatible.
  • 5. 1 2 3 4 5 6 FREE AND OPEN SOURCE The standard modules and the Python interpreter are free. PORTABLE Python interpreter exists for almost all platforms/operating systems. SIMPLE & EASY TO LEARN Python has a very simple syntax; it means it is very easy to learn and code. EXTENSIVE LIBRARIES The Python Standard Library is very exhaustive library EXTENSIBLE &EMBEDDABLE One can embed Python within a C or C++ program. OBJECT ORIENTED Python supports object- oriented programming Features of Python
  • 6. Basic syntax & Interactive shell Editing, Saving, and Running a script. Installing Python
  • 16. Basic syntax & Interactive shell Editing, Saving, and Running a script. Installing Python
  • 17. Basic syntax & Interactive shell The instructions written in Python programming language can be executed in two modes: • Interactive mode • Normal or Script mode Interactive mode: In this mode, lines of code is directly written and executed in the Python interpreter shell, which instantaneously provide the results. Normal or Script mode: In this mode the source code is saved to a file with .py extension, and the file is executed by the Python interpreter. A shell window contains an opening message followed by the special symbol >>>, called a shell prompt.
  • 18. Basic syntax & Interactive shell
  • 19. Basic syntax & Interactive shell
  • 20. Basic syntax & Interactive shell The programmer can also display the output of a value by using the print function. print(<expression>) To begin the next output on the same line as the previous one, you can place the expression end = “ ” >>> print("Python" , end = ' ') >>> print(“Programming") write a print function that includes two or more expressions separated by commas. In such a case, the print function evaluates the expressions and displays the results, separated by single spaces, on one line. print(<expression>,..., <expression>) >>> print ("Hi there") Hi there >>> print(3+4,8-5,"hello") 7 3 hello
  • 21. Basic syntax & Interactive shell Programs to ask the user for input. You can do this by using the input function. >>> name = input("Enter your name: ") Enter your name: RISE Group >>> name ' RISE Group ' >>> print(name) Ken Lambert The input function does the following: 1. Displays a prompt for the input. In this example, the prompt is "Enter your name: ". 2. Receives a string of keystrokes, called characters, entered at the keyboard and returns the string to the shell. This function causes the program to stop and wait for the user to enter a value from the keyboard.
  • 22. Basic syntax & Interactive shell • The input function always builds a string from the user’s keystrokes and returns it to the program. • After inputting strings that represent numbers, the programmer must convert them from strings to the appropriate numeric types. • In Python, there are two type conversion functions for this purpose, called int (for integers) and float (for floating point numbers). >>> first = int(input("Enter the first number: ")) Enter the first number: 23 >>> second = int(input("Enter the second number: ")) Enter the second number: 44 >>> print("The sum is", first + second) The sum is 67
  • 23. Basic syntax & Interactive shell Editing, Saving, and Running a script. Installing Python
  • 24. Editing, Saving, and Running a script. • It is more convenient to compose, edit, and save longer, more complex programs in files. • We can then run these program files or scripts either within IDLE or from the operating system’s command prompt without opening IDLE. Perform the following steps: 1. Select the option New Window from the File menu of the shell window. 2. In the new window, enter Python expressions or statements on separate lines, in the order in which you want Python to execute them. 3. At any point, you may save the file by selecting File/Save. If you do this, you should use a . py extension. For example, your first program file might be named myprogram.py. 4. To run this file of code as a Python script, select Run Module from the Run menu or press the F5 key.
  • 25. Basic syntax & Interactive shell Editing, Saving, and Running a script. Installing Python
  • 26. UNIT 1 : SYLLABUS • Conceptual introduction: topics in computer science, algorithms; • Modern computer systems: hardware architecture, data representation in computers, software and operating system; • Installing Python; basic syntax, interactive shell, editing, saving, and running a script. • The concept of data types; variables, assignments; immutable variables; numerical types; • arithmetic operators and expressions; comments in the program; understanding error messages;