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
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
Pre independence Education in Inndia.pdf
PDF
01-Introduction-to-Information-Management.pdf
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
RMMM.pdf make it easy to upload and study
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
Cell Structure & Organelles in detailed.
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
PDF
Insiders guide to clinical Medicine.pdf
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
Business Ethics Teaching Materials for college
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
TR - Agricultural Crops Production NC III.pdf
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Pre independence Education in Inndia.pdf
01-Introduction-to-Information-Management.pdf
O7-L3 Supply Chain Operations - ICLT Program
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
RMMM.pdf make it easy to upload and study
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Final Presentation General Medicine 03-08-2024.pptx
102 student loan defaulters named and shamed – Is someone you know on the list?
Cell Structure & Organelles in detailed.
Microbial diseases, their pathogenesis and prophylaxis
PPH.pptx obstetrics and gynecology in nursing
Module 4: Burden of Disease Tutorial Slides S2 2025
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
Insiders guide to clinical Medicine.pdf
O5-L3 Freight Transport Ops (International) V1.pdf
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Business Ethics Teaching Materials for college
Pharmacology of Heart Failure /Pharmacotherapy of CHF
TR - Agricultural Crops Production NC III.pdf
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