SlideShare a Scribd company logo
PYTHON PROGRAMMING
WHAT IS PYTHON?
• Python is a popular programming language. It was created by Guido van
Rossum, and released in 1991.
• It is used for:
➢Web Development (Server-side)
➢Software Development
➢Mathematics
➢System Scripting.
WHAT CAN PYTHON DO?
a) Python can be used on a server to create web applications.
b) Python can be used alongside software to create workflows.
c) Python can connect to database systems. It can also read and modify files.
d) Python can be used to handle big data and perform complex mathematics.
e) Python can be used for rapid prototyping, or for production-ready software
development.
WHY PYTHON?
• Python works on different platforms.
• It has a simple syntax similar to the English language.
• Its syntax allows developers to write programs with fewer lines.
• It runs on an interpreter system, meaning that code can be executed as soon as it is
written.
• It can be treated in a procedural way, an object-oriented way or a functional way.
PYTHON SYNTAX COMPARED TO OTHER PROGRAMMING
LANGUAGES
• Python was designed for readability, and has some similarities to the English
language with influence from mathematics.
• Python uses new lines to complete a command, as opposed to other programming
languages which often use semicolons or parentheses.
• Python relies on indentation, using whitespace, to define scope; such as the scope
of loops, functions and classes. Other programming languages often use curly-
brackets for this purpose.
PYTHON INSTALL
• To check if you have python installed on aWindows PC, search in the start bar for
Python or run the following on the Command Line (cmd.exe):
• To check if you have python installed on a Linux or Mac, then on linux open the
command line or on Mac open theTerminal and type:
• If you find that you do not have python installed on your computer, then you can
download it for free from the following website: https://www.python.org/
PYTHON INDENTATION
• Indentation refers to the spaces at the beginning of a code line.
• Where in other programming languages the indentation in code is for readability
only, the indentation in Python is very important.
• Python uses indentation to indicate a block of code.
• Python will give you an error if you skip the indentation.
• The number of spaces is up to you as a programmer, but it has to be at least one.
PYTHON COMMENTS
• Comments starts with a #, and Python will ignore them:
• A comment does not have to be text that explains the code, it can also be used to
prevent Python from executing code:
PYTHON VARIABLES
• In Python, variables are created when you assign a value to it.
• Python has no command for declaring a variable.
• Variables do not need to be declared with any particular type, and can even
change type after they have been set.
• Variable names are case-sensitive.
PYTHON VARIABLES (cont.)
• Python allows you to assign values to multiple variables in one line:
• If you have a collection of values in a list, tuple etc. Python allows you extract the
values into variables.This is called unpacking.
PYTHON VARIABLES (cont.)
• The Python print statement is often used to output variables.
• To combine both text and a variable, Python uses the + character:
• You can also use the + character to add a variable to another variable. For
numbers, the + character works as a mathematical operator
PYTHON DATA TYPES
• In programming, data type is an important concept.Variables can store data of
different types, and different types can do different things.
• Python has the following data types built-in by default, in these categories:
• You can get the data type of any object by using the type() function:
Data Type Keywords
Text: str
Numeric: int, float, complex
Sequence: list, tuple, range
Mapping: dict
Set: set, frozenset
Boolean: bool
Binary: bytes, bytearray, memoryview
Python Programming.pdf

More Related Content

PDF
Python Programming Part 1.pdf
PDF
Python Programming Part 1.pdf
PDF
Python Programming Part 1.pdf
PDF
Introduction to Python Unit -1 Part .pdf
PPTX
Introduction to Python Basics for PSSE Integration
PPTX
ITC 110 Week 10 Introdution to Python .pptx
PPTX
Python programming language introduction unit
KEY
Programming with Python: Week 1
Python Programming Part 1.pdf
Python Programming Part 1.pdf
Python Programming Part 1.pdf
Introduction to Python Unit -1 Part .pdf
Introduction to Python Basics for PSSE Integration
ITC 110 Week 10 Introdution to Python .pptx
Python programming language introduction unit
Programming with Python: Week 1

Similar to Python Programming.pdf (20)

PDF
Introduction to Python.pdf
PPTX
Introduction-to-Python-Programming1.pptx
PDF
Fundamentals of python
PPTX
Python 01.pptx
PPTX
python intro and installation.pptx
PDF
Unit 1-Part-1-Introduction to Python.pdf
PDF
Python Intro
PDF
CSC2308 - PRINCIPLE OF PROGRAMMING II.pdf
PDF
Class_X_PYTHON_J.pdf
PPTX
4_Introduction to Python Programming.pptx
PPT
python-ppt.ppt
PPT
python-ppt.ppt
PPTX
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptx
PPTX
python classes in thane
PDF
Python_Programming_PPT Basics of python programming language
PPTX
Python Programming 1.pptx
PPTX
Python Programming.pptx
PDF
Python quick guide1
PDF
Introduction to python
PPT
Py-Slides-1.pptPy-Slides-1.pptPy-Slides-1.pptPy-Slides-1.ppt
Introduction to Python.pdf
Introduction-to-Python-Programming1.pptx
Fundamentals of python
Python 01.pptx
python intro and installation.pptx
Unit 1-Part-1-Introduction to Python.pdf
Python Intro
CSC2308 - PRINCIPLE OF PROGRAMMING II.pdf
Class_X_PYTHON_J.pdf
4_Introduction to Python Programming.pptx
python-ppt.ppt
python-ppt.ppt
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptx
python classes in thane
Python_Programming_PPT Basics of python programming language
Python Programming 1.pptx
Python Programming.pptx
Python quick guide1
Introduction to python
Py-Slides-1.pptPy-Slides-1.pptPy-Slides-1.pptPy-Slides-1.ppt
Ad

Recently uploaded (20)

PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Open folder Downloads.pdf yes yes ges yes
PPTX
Open Quiz Monsoon Mind Game Final Set.pptx
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
Insiders guide to clinical Medicine.pdf
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
The Final Stretch: How to Release a Game and Not Die in the Process.
PPTX
Pharma ospi slides which help in ospi learning
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PPTX
master seminar digital applications in india
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PDF
Business Ethics Teaching Materials for college
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
BÀI TẬP TEST BỔ TRỢ THEO TỪNG CHỦ ĐỀ CỦA TỪNG UNIT KÈM BÀI TẬP NGHE - TIẾNG A...
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
Microbial diseases, their pathogenesis and prophylaxis
Open folder Downloads.pdf yes yes ges yes
Open Quiz Monsoon Mind Game Final Set.pptx
STATICS OF THE RIGID BODIES Hibbelers.pdf
Insiders guide to clinical Medicine.pdf
FourierSeries-QuestionsWithAnswers(Part-A).pdf
The Final Stretch: How to Release a Game and Not Die in the Process.
Pharma ospi slides which help in ospi learning
102 student loan defaulters named and shamed – Is someone you know on the list?
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
master seminar digital applications in india
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
Business Ethics Teaching Materials for college
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Renaissance Architecture: A Journey from Faith to Humanism
BÀI TẬP TEST BỔ TRỢ THEO TỪNG CHỦ ĐỀ CỦA TỪNG UNIT KÈM BÀI TẬP NGHE - TIẾNG A...
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Ad

Python Programming.pdf

  • 2. WHAT IS PYTHON? • Python is a popular programming language. It was created by Guido van Rossum, and released in 1991. • It is used for: ➢Web Development (Server-side) ➢Software Development ➢Mathematics ➢System Scripting.
  • 3. WHAT CAN PYTHON DO? a) Python can be used on a server to create web applications. b) Python can be used alongside software to create workflows. c) Python can connect to database systems. It can also read and modify files. d) Python can be used to handle big data and perform complex mathematics. e) Python can be used for rapid prototyping, or for production-ready software development.
  • 4. WHY PYTHON? • Python works on different platforms. • It has a simple syntax similar to the English language. • Its syntax allows developers to write programs with fewer lines. • It runs on an interpreter system, meaning that code can be executed as soon as it is written. • It can be treated in a procedural way, an object-oriented way or a functional way.
  • 5. PYTHON SYNTAX COMPARED TO OTHER PROGRAMMING LANGUAGES • Python was designed for readability, and has some similarities to the English language with influence from mathematics. • Python uses new lines to complete a command, as opposed to other programming languages which often use semicolons or parentheses. • Python relies on indentation, using whitespace, to define scope; such as the scope of loops, functions and classes. Other programming languages often use curly- brackets for this purpose.
  • 6. PYTHON INSTALL • To check if you have python installed on aWindows PC, search in the start bar for Python or run the following on the Command Line (cmd.exe): • To check if you have python installed on a Linux or Mac, then on linux open the command line or on Mac open theTerminal and type: • If you find that you do not have python installed on your computer, then you can download it for free from the following website: https://www.python.org/
  • 7. PYTHON INDENTATION • Indentation refers to the spaces at the beginning of a code line. • Where in other programming languages the indentation in code is for readability only, the indentation in Python is very important. • Python uses indentation to indicate a block of code. • Python will give you an error if you skip the indentation. • The number of spaces is up to you as a programmer, but it has to be at least one.
  • 8. PYTHON COMMENTS • Comments starts with a #, and Python will ignore them: • A comment does not have to be text that explains the code, it can also be used to prevent Python from executing code:
  • 9. PYTHON VARIABLES • In Python, variables are created when you assign a value to it. • Python has no command for declaring a variable. • Variables do not need to be declared with any particular type, and can even change type after they have been set. • Variable names are case-sensitive.
  • 10. PYTHON VARIABLES (cont.) • Python allows you to assign values to multiple variables in one line: • If you have a collection of values in a list, tuple etc. Python allows you extract the values into variables.This is called unpacking.
  • 11. PYTHON VARIABLES (cont.) • The Python print statement is often used to output variables. • To combine both text and a variable, Python uses the + character: • You can also use the + character to add a variable to another variable. For numbers, the + character works as a mathematical operator
  • 12. PYTHON DATA TYPES • In programming, data type is an important concept.Variables can store data of different types, and different types can do different things. • Python has the following data types built-in by default, in these categories: • You can get the data type of any object by using the type() function: Data Type Keywords Text: str Numeric: int, float, complex Sequence: list, tuple, range Mapping: dict Set: set, frozenset Boolean: bool Binary: bytes, bytearray, memoryview