SlideShare a Scribd company logo
Programming
Machine Cod
e
Translator
(Compiler /
Interpreter)
What is Python?
Python is simple & easy
Free & Open Source
High Level
Language
Developed by Guido
van Rossum
Portable
Our First
Program
print("Hello World")
Python Character
Set
Letters – A to Z, a to
z Digits – 0 to 9
Special Symbols - + -
* / etc.
Whitespaces – Blank
Space, tab, carriage
return, newline,
formfeed
Other characters –
Python can process
all ASCII and Unicode
characters as part of
data or literals
Variables
A variable is a name given to a memory location in a
program.
name = "Sonal"
age = 30
price = 25.99
Memory
name = "Sonal"
age = 30
price = 25.99
Rules for
Identifiers
Data Types
Integers
String
Float
Boolean
None
Data Types
Keywords
Keywords are reserved words in
python.
*False should be
uppercase
Print Sum
# Single Line
Comment
"""
Multi Line
Comment
"""
Comments in
Python
Types of Operators
An operator is a symbol that performs a certain operation between
operands.
Arithmetic Operators ( + , - , * , / , % , ** )
Relational / Comparison Operators ( == , != , > , < , >= ,
<= ) Assignment Operators ( = , +=, -= , *= , /= , %= ,
**= )
Type Conversion
a, b = 1,
2.0
sum = a + b
#error
a, b = 1,
"2"
sum = a + b
Type Casting
a, b = 1,
"2"
c = int(b)
sum = a +
c
Type
Casting
Input in Python
input( ) #result for input( ) is always a
str
int ( input( ) ) #int
float ( input( ) ) #float
give code eg of all
3
input( ) statement is used to accept values (using keyboard) from
user
Let‘s Practice
Write a Program to input 2 numbers & print their sum.
WAP to input side of a square & print its area
WAP to input 2 floating point numbers & print their average
WAP to input 2 int numbers, a and b.
Print True if a is greater than or equal to b. If not print False.
Let‘s Practice
WAP to input side of a square & print its
area.
Let‘s Practice
WAP to input 2 floating point numbers & print their
average.
Let‘s Practice
WAP to input 2 int numbers, a and b.
Print True if a is greater than or equal to b. If not print
False.

More Related Content

Similar to Lecture1_about python introduction variables (20)

PPTX
Review old Pygame made using python programming.pptx
ithepacer
 
PPTX
Introduction to python programming ( part-1)
Ziyauddin Shaik
 
PDF
Python for data science by www.dmdiploma.com
ShwetaAggarwal56
 
PPTX
Python (Data Analysis) cleaning and visualize
IruolagbePius
 
PPTX
Basics of Python Programming
ManishJha237
 
PPTX
IMP PPT- Python programming fundamentals.pptx
lemonchoos
 
PPTX
parts_of_python_programming_language.pptx
Koteswari Kasireddy
 
PDF
Chapter 0 Python Overview (Python Programming Lecture)
IoT Code Lab
 
PDF
PPE-Module-1.2 PPE-Module-1.2 PPE-Module-1.2.pdf
ArjayBalberan1
 
PPTX
introduction to python
Jincy Nelson
 
PPTX
An Introduction To Python - Python Midterm Review
Blue Elephant Consulting
 
PPTX
2. Getting Started with Python second lesson .pptx
Primary2Primary2
 
PPTX
UNIT 1 .pptx
Prachi Gawande
 
PPTX
20BCT23 – PYTHON PROGRAMMING.pptx
gokilabrindha
 
PPTX
Chapter7-Introduction to Python.pptx
lemonchoos
 
PPTX
Python 01.pptx
AliMohammadAmiri
 
PPTX
03 Variables - Chang.pptx
Dileep804402
 
PPTX
VARIABLES AND DATA TYPES IN PYTHON NEED TO STUDY
Rushikesh Kolhe
 
PPTX
#Code2Create: Python Basics
GDGKuwaitGoogleDevel
 
PPTX
unit1.pptx for python programming CSE department
rickyghoshiit
 
Review old Pygame made using python programming.pptx
ithepacer
 
Introduction to python programming ( part-1)
Ziyauddin Shaik
 
Python for data science by www.dmdiploma.com
ShwetaAggarwal56
 
Python (Data Analysis) cleaning and visualize
IruolagbePius
 
Basics of Python Programming
ManishJha237
 
IMP PPT- Python programming fundamentals.pptx
lemonchoos
 
parts_of_python_programming_language.pptx
Koteswari Kasireddy
 
Chapter 0 Python Overview (Python Programming Lecture)
IoT Code Lab
 
PPE-Module-1.2 PPE-Module-1.2 PPE-Module-1.2.pdf
ArjayBalberan1
 
introduction to python
Jincy Nelson
 
An Introduction To Python - Python Midterm Review
Blue Elephant Consulting
 
2. Getting Started with Python second lesson .pptx
Primary2Primary2
 
UNIT 1 .pptx
Prachi Gawande
 
20BCT23 – PYTHON PROGRAMMING.pptx
gokilabrindha
 
Chapter7-Introduction to Python.pptx
lemonchoos
 
Python 01.pptx
AliMohammadAmiri
 
03 Variables - Chang.pptx
Dileep804402
 
VARIABLES AND DATA TYPES IN PYTHON NEED TO STUDY
Rushikesh Kolhe
 
#Code2Create: Python Basics
GDGKuwaitGoogleDevel
 
unit1.pptx for python programming CSE department
rickyghoshiit
 

Recently uploaded (20)

PDF
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
PPTX
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
PPTX
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 
PDF
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
PPTX
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
PPTX
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
PPTX
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
PDF
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
PDF
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
PDF
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
PPTX
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
PDF
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
PDF
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
PPTX
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
PPTX
Transforming Mining & Engineering Operations with Odoo ERP | Streamline Proje...
SatishKumar2651
 
PDF
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
PDF
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
PDF
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
Transforming Mining & Engineering Operations with Odoo ERP | Streamline Proje...
SatishKumar2651
 
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
Ad

Lecture1_about python introduction variables