SlideShare uma empresa Scribd logo
1 de 23
Basic Python Programming
By
S.P. Siddique Ibrahim
AP/CSE
9/1/2019
Overview of Programming
Languages
• Machine Language: Bianary form i.e
using only 0s and 1s.
• Assembly Language: Machine operations
are represented by mnemonic code(such as ADD &
MOV)
• High Level Language: Much easier to
write than low level language because program
instruction similar like English language.
High Level Language
Compiler
• It is a software
• Translate high level language code
into machine language code(0s and
1s)
• The compiled program is called
object code.
• It is a executable code does not need
the compiler during execution.
Interpreter
• Compiler converts all source code
into machine code.
• Where the interpreter reads the
source code line by line and converts
it into object code.
Linker
• Linking the different program
modules and libraries to form a
single executable program.
Loader
• Assign memory space in RAM for
the program being executed.
Internal working of python
Syntax checker and Translator
Python Virtual Machine(PVM)
Python code
Byte code
Input
STEPS
• STEP1: Python interpreter reads a
python code and verify it for syntax
error. If it found any error, immediately
halts the translation and shows an error
message.
• STEP2: If there is no error; interpreter
translate a code into byte code
• STEP3: Byte code is sent to the PVM.
Here again the byte code is executed on
PVM. If error found then the PVM halts
and show the error message.
Commenting in Python
• Python single line comment preceded
by a hash symbol (#)
• Three consecutive single quotation
marks ‘’’ are used to give multiple
comments (or) paragraph comments.
Example
• # Now learn how to comment in
Pyhon
• Print (“I am learning Python”)
• ‘’’Python tool
• Is easy to
• Learn’’’
• Print(‘bye’)
Python character set
• Letters: upper case and lower case
• Digits: 0,1…9
• Special symblos: _,{}[]()#*&^’”:;
• White space(tnx0bx0cr) space,
tab
Token
Python Tokens
Literals
Delimit
ers
Operators
Variables/Ide
ntifiers
Keywords
1. Literal
• Literals are numbers or strings or characters
appear in the program.
• Example:
• 78 – Integer literal
• 21.32- floating point literal
• ‘q’- character literal
• “Hello” – String literal
• (Python also contain list and dictionary)-see
later chapter
2. Value and Type
• To know type of any value in Python
use in-build method called
type(value)
• Example:
• >>>type(‘hello’)
• >>>type(“hello”)
• >>>type(123)
Keywords
• Keywords are fixed
meaning/reserved words.
• Cannot be used as
identifiers/variables.
• Sample keywords: from, none, with,
while, true, return, is , in, import, if ,
gloabl, for, finally, else….
Operator
• Python contains various operators
• Arithmetic - + - * / % **
• Relational == != <> <= >=
• Logical and not or
• Bitwise &~|^<< >>
Delimiter
• It is symbol that perform special role
in python like grouping, punctuation
and assignment
• () [] {}
• , :. = ;
Variable
• Identifier is the name used to find variable,
function, class or other objects
• Rules:
• Character consists of letter, underscore,
digits,
• Can be any length
• Starts with letter
• Can start with _
• Cannot starts with a digit
• Cannot be a keyword
Example
• First name
• 23name
• For
• Valid- name, _address, roll_no
The Print() Function
• The task of print function is to
display the contents on the screen
• Print(argument)
• >>>print(‘Hello welcome to python
programming’)
• Print(1000)
Print with quotation
• Use ()-backslash
• Print(“the attachment,
”remaining””)
Print with end argument
• Print(‘hello’,end=‘’)
• Print(‘world’,end=‘’)
• Print(‘goodbye’)

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Introduction to python programming
Introduction to python programmingIntroduction to python programming
Introduction to python programming
 
Introduction To Python | Edureka
Introduction To Python | EdurekaIntroduction To Python | Edureka
Introduction To Python | Edureka
 
Python basic
Python basicPython basic
Python basic
 
Basic Concepts in Python
Basic Concepts in PythonBasic Concepts in Python
Basic Concepts in Python
 
Python Course | Python Programming | Python Tutorial | Python Training | Edureka
Python Course | Python Programming | Python Tutorial | Python Training | EdurekaPython Course | Python Programming | Python Tutorial | Python Training | Edureka
Python Course | Python Programming | Python Tutorial | Python Training | Edureka
 
Python - An Introduction
Python - An IntroductionPython - An Introduction
Python - An Introduction
 
Python ppt
Python pptPython ppt
Python ppt
 
Python programming | Fundamentals of Python programming
Python programming | Fundamentals of Python programming Python programming | Fundamentals of Python programming
Python programming | Fundamentals of Python programming
 
Presentation on python
Presentation on pythonPresentation on python
Presentation on python
 
Python Tutorial Part 1
Python Tutorial Part 1Python Tutorial Part 1
Python Tutorial Part 1
 
Python by Rj
Python by RjPython by Rj
Python by Rj
 
Introduction to Python - Training for Kids
Introduction to Python - Training for KidsIntroduction to Python - Training for Kids
Introduction to Python - Training for Kids
 
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYAChapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Operators in python
Operators in pythonOperators in python
Operators in python
 
Python
PythonPython
Python
 
Introduction to Python Basics Programming
Introduction to Python Basics ProgrammingIntroduction to Python Basics Programming
Introduction to Python Basics Programming
 
Intro to Python
Intro to PythonIntro to Python
Intro to Python
 
Python final ppt
Python final pptPython final ppt
Python final ppt
 
Python basic
Python basicPython basic
Python basic
 

Semelhante a Python programming introduction

presentation_python_7_1569170870_375360.pptx
presentation_python_7_1569170870_375360.pptxpresentation_python_7_1569170870_375360.pptx
presentation_python_7_1569170870_375360.pptx
ansariparveen06
 
Chapter-introduction about java programming
Chapter-introduction about java programmingChapter-introduction about java programming
Chapter-introduction about java programming
DrRajeshkumarPPatel
 
Compiler Construction Lecture One .pptx
Compiler Construction Lecture One  .pptxCompiler Construction Lecture One  .pptx
Compiler Construction Lecture One .pptx
انشال عارف
 

Semelhante a Python programming introduction (20)

Py-Slides- easuajsjsjejejjwlqpqpqpp1.pdf
Py-Slides- easuajsjsjejejjwlqpqpqpp1.pdfPy-Slides- easuajsjsjejejjwlqpqpqpp1.pdf
Py-Slides- easuajsjsjejejjwlqpqpqpp1.pdf
 
presentation_python_7_1569170870_375360.pptx
presentation_python_7_1569170870_375360.pptxpresentation_python_7_1569170870_375360.pptx
presentation_python_7_1569170870_375360.pptx
 
Unit ii
Unit   iiUnit   ii
Unit ii
 
Python Programming
Python ProgrammingPython Programming
Python Programming
 
X-CS-8.0 Programming in C Language 2022-2023.pdf
X-CS-8.0 Programming in C Language 2022-2023.pdfX-CS-8.0 Programming in C Language 2022-2023.pdf
X-CS-8.0 Programming in C Language 2022-2023.pdf
 
Python Programming 1.pptx
Python Programming 1.pptxPython Programming 1.pptx
Python Programming 1.pptx
 
Introduction to Python Programing
Introduction to Python ProgramingIntroduction to Python Programing
Introduction to Python Programing
 
C language unit-1
C language unit-1C language unit-1
C language unit-1
 
C LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDY
C LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDYC LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDY
C LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDY
 
C languaGE UNIT-1
C languaGE UNIT-1C languaGE UNIT-1
C languaGE UNIT-1
 
COMPILER DESIGN PPTS.pptx
COMPILER DESIGN PPTS.pptxCOMPILER DESIGN PPTS.pptx
COMPILER DESIGN PPTS.pptx
 
Introduction_to_Programming.pptx
Introduction_to_Programming.pptxIntroduction_to_Programming.pptx
Introduction_to_Programming.pptx
 
Python (3).pdf
Python (3).pdfPython (3).pdf
Python (3).pdf
 
Lecture 01 introduction to compiler
Lecture 01 introduction to compilerLecture 01 introduction to compiler
Lecture 01 introduction to compiler
 
Compilers.pptx
Compilers.pptxCompilers.pptx
Compilers.pptx
 
Pros and cons of c as a compiler language
  Pros and cons of c as a compiler language  Pros and cons of c as a compiler language
Pros and cons of c as a compiler language
 
Life cycle of a computer program
Life cycle of a computer programLife cycle of a computer program
Life cycle of a computer program
 
Chapter-introduction about java programming
Chapter-introduction about java programmingChapter-introduction about java programming
Chapter-introduction about java programming
 
Compiler Construction Lecture One .pptx
Compiler Construction Lecture One  .pptxCompiler Construction Lecture One  .pptx
Compiler Construction Lecture One .pptx
 
Programming with Python: Week 1
Programming with Python: Week 1Programming with Python: Week 1
Programming with Python: Week 1
 

Mais de Siddique Ibrahim

Mais de Siddique Ibrahim (20)

List in Python
List in PythonList in Python
List in Python
 
Python Control structures
Python Control structuresPython Control structures
Python Control structures
 
Data mining basic fundamentals
Data mining basic fundamentalsData mining basic fundamentals
Data mining basic fundamentals
 
Basic networking
Basic networkingBasic networking
Basic networking
 
Virtualization Concepts
Virtualization ConceptsVirtualization Concepts
Virtualization Concepts
 
Networking devices(siddique)
Networking devices(siddique)Networking devices(siddique)
Networking devices(siddique)
 
Osi model 7 Layers
Osi model 7 LayersOsi model 7 Layers
Osi model 7 Layers
 
Mysql grand
Mysql grandMysql grand
Mysql grand
 
Getting started into mySQL
Getting started into mySQLGetting started into mySQL
Getting started into mySQL
 
pipelining
pipeliningpipelining
pipelining
 
Micro programmed control
Micro programmed controlMicro programmed control
Micro programmed control
 
Hardwired control
Hardwired controlHardwired control
Hardwired control
 
interface
interfaceinterface
interface
 
Interrupt
InterruptInterrupt
Interrupt
 
Interrupt
InterruptInterrupt
Interrupt
 
DMA
DMADMA
DMA
 
Io devies
Io deviesIo devies
Io devies
 
Stack & queue
Stack & queueStack & queue
Stack & queue
 
Metadata in data warehouse
Metadata in data warehouseMetadata in data warehouse
Metadata in data warehouse
 
Data extraction, transformation, and loading
Data extraction, transformation, and loadingData extraction, transformation, and loading
Data extraction, transformation, and loading
 

Último

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

Python programming introduction

  • 1. Basic Python Programming By S.P. Siddique Ibrahim AP/CSE 9/1/2019
  • 2. Overview of Programming Languages • Machine Language: Bianary form i.e using only 0s and 1s. • Assembly Language: Machine operations are represented by mnemonic code(such as ADD & MOV) • High Level Language: Much easier to write than low level language because program instruction similar like English language.
  • 4. Compiler • It is a software • Translate high level language code into machine language code(0s and 1s) • The compiled program is called object code. • It is a executable code does not need the compiler during execution.
  • 5. Interpreter • Compiler converts all source code into machine code. • Where the interpreter reads the source code line by line and converts it into object code.
  • 6. Linker • Linking the different program modules and libraries to form a single executable program.
  • 7. Loader • Assign memory space in RAM for the program being executed.
  • 8. Internal working of python Syntax checker and Translator Python Virtual Machine(PVM) Python code Byte code Input
  • 9. STEPS • STEP1: Python interpreter reads a python code and verify it for syntax error. If it found any error, immediately halts the translation and shows an error message. • STEP2: If there is no error; interpreter translate a code into byte code • STEP3: Byte code is sent to the PVM. Here again the byte code is executed on PVM. If error found then the PVM halts and show the error message.
  • 10. Commenting in Python • Python single line comment preceded by a hash symbol (#) • Three consecutive single quotation marks ‘’’ are used to give multiple comments (or) paragraph comments.
  • 11. Example • # Now learn how to comment in Pyhon • Print (“I am learning Python”) • ‘’’Python tool • Is easy to • Learn’’’ • Print(‘bye’)
  • 12. Python character set • Letters: upper case and lower case • Digits: 0,1…9 • Special symblos: _,{}[]()#*&^’”:; • White space(tnx0bx0cr) space, tab
  • 14. 1. Literal • Literals are numbers or strings or characters appear in the program. • Example: • 78 – Integer literal • 21.32- floating point literal • ‘q’- character literal • “Hello” – String literal • (Python also contain list and dictionary)-see later chapter
  • 15. 2. Value and Type • To know type of any value in Python use in-build method called type(value) • Example: • >>>type(‘hello’) • >>>type(“hello”) • >>>type(123)
  • 16. Keywords • Keywords are fixed meaning/reserved words. • Cannot be used as identifiers/variables. • Sample keywords: from, none, with, while, true, return, is , in, import, if , gloabl, for, finally, else….
  • 17. Operator • Python contains various operators • Arithmetic - + - * / % ** • Relational == != <> <= >= • Logical and not or • Bitwise &~|^<< >>
  • 18. Delimiter • It is symbol that perform special role in python like grouping, punctuation and assignment • () [] {} • , :. = ;
  • 19. Variable • Identifier is the name used to find variable, function, class or other objects • Rules: • Character consists of letter, underscore, digits, • Can be any length • Starts with letter • Can start with _ • Cannot starts with a digit • Cannot be a keyword
  • 20. Example • First name • 23name • For • Valid- name, _address, roll_no
  • 21. The Print() Function • The task of print function is to display the contents on the screen • Print(argument) • >>>print(‘Hello welcome to python programming’) • Print(1000)
  • 22. Print with quotation • Use ()-backslash • Print(“the attachment, ”remaining””)
  • 23. Print with end argument • Print(‘hello’,end=‘’) • Print(‘world’,end=‘’) • Print(‘goodbye’)