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)

PPT
Python Programming Introduction demo.ppt
JohariNawab
ย 
PPTX
MODULE. .pptx
Alpha337901
ย 
PDF
python-online&offline-training-in-kphb-hyderabad (1) (1).pdf
KosmikTech1
ย 
PDF
Basic Concepts in Python
Sumit Satam
ย 
PPTX
Python knowledge ,......................
sabith777a
ย 
PPTX
C++ lecture 01
HNDE Labuduwa Galle
ย 
PDF
PART - 1 Python Introduction- Variables- Data types - Numeric- String- Boole...
manikamr074
ย 
PPTX
Chapter1 python introduction syntax general
ssuser77162c
ย 
PPTX
Python.pptx
EliasPetros
ย 
PPTX
python fudmentalsYYour score increaseases
ssuser61d324
ย 
PPTX
Keep it Stupidly Simple Introduce Python
SushJalai
ย 
PPTX
lecture 2.pptx
Anonymous9etQKwW
ย 
PPTX
Introduction to learn and Python Interpreter
Alamelu
ย 
PPTX
chapter_5_ppt_em_220247.pptx
RAJAMURUGANAMECAPCSE
ย 
PPTX
C PROGRAMMING document for beginners....
reethabar
ย 
PPTX
Python
Gagandeep Nanda
ย 
PPTX
Python Scipy Numpy
Girish Khanzode
ย 
PPTX
GRADE 11 Chapter 5 - Python Fundamentals.pptx
DeepaRavi21
ย 
PPTX
Python Introduction
vikram mahendra
ย 
PPT
02a fundamental c++ types, arithmetic
Manzoor ALam
ย 
Python Programming Introduction demo.ppt
JohariNawab
ย 
MODULE. .pptx
Alpha337901
ย 
python-online&offline-training-in-kphb-hyderabad (1) (1).pdf
KosmikTech1
ย 
Basic Concepts in Python
Sumit Satam
ย 
Python knowledge ,......................
sabith777a
ย 
C++ lecture 01
HNDE Labuduwa Galle
ย 
PART - 1 Python Introduction- Variables- Data types - Numeric- String- Boole...
manikamr074
ย 
Chapter1 python introduction syntax general
ssuser77162c
ย 
Python.pptx
EliasPetros
ย 
python fudmentalsYYour score increaseases
ssuser61d324
ย 
Keep it Stupidly Simple Introduce Python
SushJalai
ย 
lecture 2.pptx
Anonymous9etQKwW
ย 
Introduction to learn and Python Interpreter
Alamelu
ย 
chapter_5_ppt_em_220247.pptx
RAJAMURUGANAMECAPCSE
ย 
C PROGRAMMING document for beginners....
reethabar
ย 
Python
Gagandeep Nanda
ย 
Python Scipy Numpy
Girish Khanzode
ย 
GRADE 11 Chapter 5 - Python Fundamentals.pptx
DeepaRavi21
ย 
Python Introduction
vikram mahendra
ย 
02a fundamental c++ types, arithmetic
Manzoor ALam
ย 

Recently uploaded (20)

PPTX
NeuroStrata: Harnessing Neuro-Symbolic Paradigms for Improved Testability and...
Ivan Ruchkin
ย 
PDF
AI Software Development Process, Strategies and Challenges
Net-Craft.com
ย 
PPTX
How Can Recruitment Management Software Improve Hiring Efficiency?
HireME
ย 
PPTX
CV-Project_2024 version 01222222222.pptx
MohammadSiddiqui70
ย 
PPTX
Automatic_Iperf_Log_Result_Excel_visual_v2.pptx
Chen-Chih Lee
ย 
PDF
Automated Test Case Repair Using Language Models
Lionel Briand
ย 
PDF
AWS Consulting Services: Empowering Digital Transformation with Nlineaxis
Nlineaxis IT Solutions Pvt Ltd
ย 
PDF
Difference Between Kubernetes and Docker .pdf
Kindlebit Solutions
ย 
PPTX
IObit Driver Booster Pro 12.4-12.5 license keys 2025-2026
chaudhryakashoo065
ย 
PPTX
ERP - FICO Presentation BY BSL BOKARO STEEL LIMITED.pptx
ravisranjan
ย 
PDF
Automated Testing and Safety Analysis of Deep Neural Networks
Lionel Briand
ย 
PDF
LPS25 - Operationalizing MLOps in GEP - Terradue.pdf
terradue
ย 
PDF
Telemedicine App Development_ Key Factors to Consider for Your Healthcare Ven...
Mobilityinfotech
ย 
PPTX
IObit Driver Booster Pro Crack Download Latest Version
chaudhryakashoo065
ย 
PPTX
Iobit Driver Booster Pro 12 Crack Free Download
chaudhryakashoo065
ย 
PDF
Why Edge Computing Matters in Mobile Application Tech.pdf
IMG Global Infotech
ย 
PDF
TEASMA: A Practical Methodology for Test Adequacy Assessment of Deep Neural N...
Lionel Briand
ย 
PDF
Cloud computing Lec 02 - virtualization.pdf
asokawennawatte
ย 
PPTX
For my supp to finally picking supp that work
necas19388
ย 
PPTX
Introduction to web development | MERN Stack
JosephLiyon
ย 
NeuroStrata: Harnessing Neuro-Symbolic Paradigms for Improved Testability and...
Ivan Ruchkin
ย 
AI Software Development Process, Strategies and Challenges
Net-Craft.com
ย 
How Can Recruitment Management Software Improve Hiring Efficiency?
HireME
ย 
CV-Project_2024 version 01222222222.pptx
MohammadSiddiqui70
ย 
Automatic_Iperf_Log_Result_Excel_visual_v2.pptx
Chen-Chih Lee
ย 
Automated Test Case Repair Using Language Models
Lionel Briand
ย 
AWS Consulting Services: Empowering Digital Transformation with Nlineaxis
Nlineaxis IT Solutions Pvt Ltd
ย 
Difference Between Kubernetes and Docker .pdf
Kindlebit Solutions
ย 
IObit Driver Booster Pro 12.4-12.5 license keys 2025-2026
chaudhryakashoo065
ย 
ERP - FICO Presentation BY BSL BOKARO STEEL LIMITED.pptx
ravisranjan
ย 
Automated Testing and Safety Analysis of Deep Neural Networks
Lionel Briand
ย 
LPS25 - Operationalizing MLOps in GEP - Terradue.pdf
terradue
ย 
Telemedicine App Development_ Key Factors to Consider for Your Healthcare Ven...
Mobilityinfotech
ย 
IObit Driver Booster Pro Crack Download Latest Version
chaudhryakashoo065
ย 
Iobit Driver Booster Pro 12 Crack Free Download
chaudhryakashoo065
ย 
Why Edge Computing Matters in Mobile Application Tech.pdf
IMG Global Infotech
ย 
TEASMA: A Practical Methodology for Test Adequacy Assessment of Deep Neural N...
Lionel Briand
ย 
Cloud computing Lec 02 - virtualization.pdf
asokawennawatte
ย 
For my supp to finally picking supp that work
necas19388
ย 
Introduction to web development | MERN Stack
JosephLiyon
ย 
Ad

Lecture1_about python introduction variables