SlideShare a Scribd company logo
8
Most read
9
Most read
12
Most read
Introduction to Python
K Harisai,
Executive Committee Member, Swecha,
Senior Software Engineer, Syncoffice
Agenda
● What is python and Why Python
● Variables and Data Types
● Operators
● Control Flow Statements
● Functions
● Lists, Tuples, Dictionaries
● File Handling
● Libraries and Modules
What is Python
● Python is an interpreted, high level, general purpose programming language.
● Created by Guido van Rossum and first released in 1991.
● Python is a programming language that lets you work quickly and integrate systems more
effectively.
● Uses:
○ Web development
○ Software development
○ Mathematics
○ System scripting
○ Machine Learning
Why Python?
● Easy to learn
● Versatile(can be used for developing wide range of applications)
● Large Community
● Cross platform Compatibility
● Interpreted Language
● Great for Rapid Prototyping
Image Source: IEEE Spectrum
Installing Python
● Sudo apt install python3
● To install python packages follow these steps
○ Sudo apt install python3-pip
○ Pip install <Package Name>
● https://www.python.org/downloads/
Running Python Code
● There are several ways to run the python code on different development
environment.
● There are 3 types of environments.
– Text editors.
– Full IDEs.
– Notebook environments.
Python syntax
● Python is designed to be a highly readable programming language
● Unlike other programming languages, python uses “Indentation”
○ Ex:
Variables and Datatypes
● my_string = “Hello World”
● my_number = 12
● my_float = 12.50
● my_boolean = True
Lists, Tuples, and Dictionaries
# List
my_list = ["apple", "banana", "cherry"]
print(my_list[1])
# Tuple
my_tuple = ("apple", "banana", "cherry")
print(my_tuple[1])
# Dictionary
my_dict = {"name": "John", "age": 30, "city": "New
York"}
print(my_dict["age"])
* Lists are Ordered Collection Items, and they are mutable, Whereas Tuples are
Immutable
Operators
# Arithmetic Operators
a = 5
b = 3
print(a + b)
print(a - b)
print(a * b)
print(a / b)
print(a % b)
# Comparison Operators
a = 5
b = 3
print(a > b)
print(a < b)
print(a == b)
print(a != b)
# Logical Operators
a = True
b = False
print(a and b)
print(a or b)
print(not a)
Control Flow Statements:
# If Statement
x = 5
if x > 0:
print("x is positive")
elif x < 0:
print("x is negative")
else:
print("x is zero")
# For Loop
for i in range(5):
print(i)
# While Loop
x = 0
while x < 5:
print(x)
x += 1
Functions:
def say_hello(name):
print("Hello, " + name + "!")
say_hello("John")
File Handling
# Read from a file
with open("myfile.txt", "r") as file:
data = file.read()
print(data)
# Write to a file
with open("myfile.txt", "w") as
file:
file.write("Hello, World!")
Libraries and Modules
#Importing the math
Library
import math
print(math.sqrt(16))
# Creating a custom module
# mymodule.py
def say_hello(name):
print("Hello, " + name + "!")
# main.py
import mymodule
mymodule.say_hello("John")
Python Oops
Questions
Python Presentation.pdf introduction of python programing

More Related Content

PPTX
Python bible
PPTX
Basic concept of Python.pptx includes design tool, identifier, variables.
PPTX
UNIT 1 .pptx
PPTX
python introduction initial lecture unit1.pptx
PDF
Python for scientific computing
PDF
Python basics_ part1
PPTX
Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...
PPTX
modul-python-part1.pptx
Python bible
Basic concept of Python.pptx includes design tool, identifier, variables.
UNIT 1 .pptx
python introduction initial lecture unit1.pptx
Python for scientific computing
Python basics_ part1
Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...
modul-python-part1.pptx

Similar to Python Presentation.pdf introduction of python programing (20)

ODP
An Intro to Python in 30 minutes
PPTX
All_About_Python_and_more+Cambridge.pptx
PPTX
Python programming
PDF
Blueprints: Introduction to Python programming
PPTX
Python chapter presentation details.pptx
PPTX
python_class.pptx
PPTX
4. Tools Proyek Data Science DTS-TA v.3.pptx
PPTX
python presntation 2.pptx
PPTX
Integrating Python with SQL (12345).pptx
PPTX
python programming for beginners and advanced
PPTX
Introduction to learn and Python Interpreter
PPTX
PPT
Python programming
PPTX
Python Introduction
PDF
Intro-to-Python-Part-1-first-part-edition.pdf
PPTX
modul-python-all.pptx
PPTX
Pythonppt28 11-18
PPTX
FUNDAMENTALS OF PYTHON LANGUAGE
PPTX
bhaskars.pptx
PPTX
Machine learning session3(intro to python)
An Intro to Python in 30 minutes
All_About_Python_and_more+Cambridge.pptx
Python programming
Blueprints: Introduction to Python programming
Python chapter presentation details.pptx
python_class.pptx
4. Tools Proyek Data Science DTS-TA v.3.pptx
python presntation 2.pptx
Integrating Python with SQL (12345).pptx
python programming for beginners and advanced
Introduction to learn and Python Interpreter
Python programming
Python Introduction
Intro-to-Python-Part-1-first-part-edition.pdf
modul-python-all.pptx
Pythonppt28 11-18
FUNDAMENTALS OF PYTHON LANGUAGE
bhaskars.pptx
Machine learning session3(intro to python)
Ad

Recently uploaded (20)

PDF
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PPT
Project quality management in manufacturing
PPT
introduction to datamining and warehousing
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PDF
Well-logging-methods_new................
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
DOCX
573137875-Attendance-Management-System-original
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PDF
Digital Logic Computer Design lecture notes
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPTX
Artificial Intelligence
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
Operating System & Kernel Study Guide-1 - converted.pdf
Project quality management in manufacturing
introduction to datamining and warehousing
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
Well-logging-methods_new................
Embodied AI: Ushering in the Next Era of Intelligent Systems
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
573137875-Attendance-Management-System-original
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
Digital Logic Computer Design lecture notes
UNIT-1 - COAL BASED THERMAL POWER PLANTS
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
Artificial Intelligence
Automation-in-Manufacturing-Chapter-Introduction.pdf
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Ad

Python Presentation.pdf introduction of python programing

  • 1. Introduction to Python K Harisai, Executive Committee Member, Swecha, Senior Software Engineer, Syncoffice
  • 2. Agenda ● What is python and Why Python ● Variables and Data Types ● Operators ● Control Flow Statements ● Functions ● Lists, Tuples, Dictionaries ● File Handling ● Libraries and Modules
  • 3. What is Python ● Python is an interpreted, high level, general purpose programming language. ● Created by Guido van Rossum and first released in 1991. ● Python is a programming language that lets you work quickly and integrate systems more effectively. ● Uses: ○ Web development ○ Software development ○ Mathematics ○ System scripting ○ Machine Learning
  • 4. Why Python? ● Easy to learn ● Versatile(can be used for developing wide range of applications) ● Large Community ● Cross platform Compatibility ● Interpreted Language ● Great for Rapid Prototyping Image Source: IEEE Spectrum
  • 5. Installing Python ● Sudo apt install python3 ● To install python packages follow these steps ○ Sudo apt install python3-pip ○ Pip install <Package Name> ● https://www.python.org/downloads/
  • 6. Running Python Code ● There are several ways to run the python code on different development environment. ● There are 3 types of environments. – Text editors. – Full IDEs. – Notebook environments.
  • 7. Python syntax ● Python is designed to be a highly readable programming language ● Unlike other programming languages, python uses “Indentation” ○ Ex:
  • 8. Variables and Datatypes ● my_string = “Hello World” ● my_number = 12 ● my_float = 12.50 ● my_boolean = True
  • 9. Lists, Tuples, and Dictionaries # List my_list = ["apple", "banana", "cherry"] print(my_list[1]) # Tuple my_tuple = ("apple", "banana", "cherry") print(my_tuple[1]) # Dictionary my_dict = {"name": "John", "age": 30, "city": "New York"} print(my_dict["age"]) * Lists are Ordered Collection Items, and they are mutable, Whereas Tuples are Immutable
  • 10. Operators # Arithmetic Operators a = 5 b = 3 print(a + b) print(a - b) print(a * b) print(a / b) print(a % b) # Comparison Operators a = 5 b = 3 print(a > b) print(a < b) print(a == b) print(a != b) # Logical Operators a = True b = False print(a and b) print(a or b) print(not a)
  • 11. Control Flow Statements: # If Statement x = 5 if x > 0: print("x is positive") elif x < 0: print("x is negative") else: print("x is zero") # For Loop for i in range(5): print(i) # While Loop x = 0 while x < 5: print(x) x += 1
  • 12. Functions: def say_hello(name): print("Hello, " + name + "!") say_hello("John")
  • 13. File Handling # Read from a file with open("myfile.txt", "r") as file: data = file.read() print(data) # Write to a file with open("myfile.txt", "w") as file: file.write("Hello, World!")
  • 14. Libraries and Modules #Importing the math Library import math print(math.sqrt(16)) # Creating a custom module # mymodule.py def say_hello(name): print("Hello, " + name + "!") # main.py import mymodule mymodule.say_hello("John")