SlideShare a Scribd company logo
Chapter 0 Python Overview (Python Programming Lecture)
PYTHON
PROGRAMMING
Chapter 0
Python Overview
Topic
• Python Introduction
• What is Python?
• Story of Python
• Why Python
• Use of Python
• Python Download + Installation
• How to Use? + Online Course
Resource
• First Program - Hello World
• Comment
• Variable + Data Type
• Variable Naming Convention
• Input/ Output
• Type Casting
• Built in Function
PYTHON
PROGRAMMING
Chapter 0
Lecture 0.0
Python Introduction
Python – What is?
• Object Oriented
• High Level
• General Purpose Programming Language
• Interpreted
• Dynamic Semantics
Python – Story
• Created by Guido van Rossum
• The name Python was inspired by the BBC TV show Monty Python's
Flying Circus
• Implementation began in December 1989
• Initial Release (labeled version 0.9.0) => 20 February 1991
• Python 1.0 => January 1994
• Python 2.0 => 16 October 2000
• Python 3.0 => 3 December 2008
Python – Why?
• Easy to learn
• Open source
• One of the most influential programming languages
Python - Use
• Scientific and Numeric analysis
• Web Development
• Desktop GUIs
• Data Science
• Artificial Intelligence
• Machine Learning
• Data Analysis
• Data Visualization
Python – Download
Python – Installation
Python – Installation
Python – Installation Page 2
Python – Installation Page 3
Python – After Installation
Python – Installation – IDE Interface
Python – Installation – IDE Interface
Python – Installation – IDE Interface
Python – Installation – IDE Interface
Python – Installation – IDE Interface
Any Question?
Like, Comment, Share
Subscribe
Chapter 0 Python Overview (Python Programming Lecture)
PYTHON
PROGRAMMING
Chapter 0
Lecture 0.1
Variable, Data Type, Expression
Create First Python Program File
• Python IDLE
• File -> New File -> Save (/Save As) -> Hello.py
• Write Python Program
• Run -> Run Module (/F5)
Write First Python Program
print("Hello World")
Comment
# Single Line Comment
"""
Multi
Line
Comment
"""
First Python Program Modified 1
# First Python Program
# Program Name: Hello World
# Author Name: Mun Al Mamun
# A Program to Print a text
print("Hello World")
First Python Program Modified 2
"""
First Python Program
Program Name: Hello World
Author Name: Mun Al Mamun
A Program to Print a text
"""
print("Hello World")
Variable
• Symbolic name to store date in computer program
Data Type
• Integer => 0, 2, 20038, -332
• Float => 5.5, 3.1416, -40.56
• String => Hello World, This is 2019
• Boolean => True, False
Variable (Integer)
# Integer Variable
my_roll = 50
print(my_roll)
Variable (Integer) + Data Type
# Integer Variable with Data Type
my_roll = 50
print(my_roll)
print(type(my_roll))
Variable (Float) + Data Type
# Float Variable with Data Type
my_gpa = 4.5
print(my_gpa)
print(type(my_gpa))
Variable (String) + Data Type
# String Variable with Data Type
my_name = "My Name is Mun"
print(my_name)
print(type(my_name))
Variable (Boolean) + Data Type
# Boolean Variable with Data Type
test = True
print(test)
print(type(test))
Variable (Boolean) + Data Type [2]
# Boolean Variable with Data Type
test = False
print(test)
print(type(test))
NoneType
# NoneType Variable with Data Type
value = None
print(value)
print(type(value))
Data Type
• str (String)
• int (Integer)
• float (Float)
• bool (Boolean)
• None (NoneType)
Variable Naming Convention
• Must begin with a letter (a - z, A - B) or underscore (_)
• Other characters can be letters, numbers or _
• Variable names are case-sensitive
• Variables should be all lowercase
• Words in a variable name should be separated by an underscore
• Don't start name with a digit.
• Never use special symbols like !, @, #, $, %
• Reserved words cannot be used as a variable
https://visualgit.readthedocs.io/en/latest/pages/naming_convention.html
Practice Problem 0.1
1. Declare a Integer variable and print value with data type
2. Declare a Float variable and print value with data type
3. Declare a String variable and print value with data type
4. Declare a Boolean variable and print value with data type
5. Declare a NoneType variable and print value with data type
Any Question?
Like, Comment, Share
Subscribe
Chapter 0 Python Overview (Python Programming Lecture)
PYTHON
PROGRAMMING
Chapter 0
Lecture 0.2.1
Input Output (String)
Input/Output 1
# input a String
name = input()
print(name)
Input/Output 1 (Con.)[Display Message 1]
#input a String
print("Input Your Name")
name = input()
print(name)
Input/Output 1 (Con.)[Display Message 2]
#input a String
name = input("Input Your Name: ")
print(name)
Input/Output + Data Type
#input a String
name = input("Input Your Name: ")
print(name)
print(type(name))
Input Your Name
# Solution 1:
# input a String and Display the String
name = input()
print(name)
# Solution 2:
# input a String with Message in print()
print("Input Your Name")
name = input()
print(name)
# Solution 3:
# input a String with Message in input()
name = input("Input Your Name: ")
print(name)
# Solution 4:
#input a String and Know Datatype
name = input("Input Your Name: ")
print(name)
print(type(name))
Practice Problem 0.2
1. Input your Name and print the value
2. Input your Name with a massage and print the value
3. Input your Name with a massage in input() function and
print the value
4. Input your Name with a massage in input() function and
print the value with data type
Any Question?
Like, Comment, Share
Subscribe
Chapter 0 Python Overview (Python Programming Lecture)
PYTHON
PROGRAMMING
Chapter 0
Lecture 0.2.2
Input Output (Number)
Input an Integer Number
age = input()
print(age)
Input an Integer Number [Con.][Data Type]
age = input()
print(age)
print(type(age))
• All Input is String in Python
• We have to Type Cast to convert String into Integer.
Input an Integer Number (*)
age = input()
print(age)
print(type(age))
# Type Cast to Integer Number
age = int(age)
print(age)
print(type(age))
Input an Integer Number [Final]
age = int(input())
print(age)
print(type(age))
Input an Float Number
gpa = input()
print(gpa)
print(type(gpa))
Input an Float Number (*)
gpa = input()
print(gpa)
print(type(gpa))
# Type Cast to Float Number
gpa = float(gpa)
print(type(gpa))
print(gpa)
Input an Float Number [Final]
gpa = float(input())
print(gpa)
print(type(gpa))
Built-in Function
• print()
• input()
• type()
• int()
• float()
Built-in Function
source: https://docs.python.org/3.6/library/functions.html
Practice Problem 0.3
1. Input your age and print data with type (Be sure about
type conversion to integer)
2. Input your gpa and print data with type (Be sure about
type conversion to float)
Any Question?
Like, Comment, Share
Subscribe
Chapter 0 Python Overview (Python Programming Lecture)
PYTHON
PROGRAMMING
Chapter 0
Lecture 0.2.3
Formatted Input Output
Formatted I/O
name = input("What is Your Name: ")
print("Hello,", name)
roll = int(input("What is Your Roll: "))
print("Your roll is:", roll)
gpa = float(input("What is Your GPA: "))
print("Your GPA is", gpa)
Formatted I/O 2
name = input("What is Your Name: ")
roll = int(input("What is Your Roll: "))
gpa = float(input("What is Your GPA: "))
print(name,roll,gpa)
Formatted I/O 3
#Input Name with Formatted Output
name = input("What is Your Name: ")
1. print("Hello,",name)
2. print("Hello,", name, "How are You", name, "?")
3. print("Hello,", name, "nHow are You", name, "?")
4. print("Hello, {}nHow are You {}?".format(name,name))
5. print(f"Hello, {name}nHow are You {name}?")
Any Question?
Like, Comment, Share
Subscribe
Chapter 0 Python Overview (Python Programming Lecture)

More Related Content

PDF
Never Split the Difference Cheat-Sheet
Yan-David Erlich
 
PDF
Python - the basics
University of Technology
 
PDF
Python programming
Prof. Dr. K. Adisesha
 
PDF
Mastering ArcGIS Pro 2nd edition 2023.pdf
PhoemBunnara1
 
PPTX
Basic Computer Organization and Design
Kamal Acharya
 
PPTX
instruction cycle ppt
sheetal singh
 
PPTX
Introduction to ChatGPT
Damian T. Gordon
 
PPTX
Python basics
Hoang Nguyen
 
Never Split the Difference Cheat-Sheet
Yan-David Erlich
 
Python - the basics
University of Technology
 
Python programming
Prof. Dr. K. Adisesha
 
Mastering ArcGIS Pro 2nd edition 2023.pdf
PhoemBunnara1
 
Basic Computer Organization and Design
Kamal Acharya
 
instruction cycle ppt
sheetal singh
 
Introduction to ChatGPT
Damian T. Gordon
 
Python basics
Hoang Nguyen
 

What's hot (20)

PDF
Chapter 2 Decision Making (Python Programming Lecture)
IoT Code Lab
 
PDF
Chapter 1 Basic Programming (Python Programming Lecture)
IoT Code Lab
 
PPTX
Python programming
Ashwin Kumar Ramasamy
 
PDF
Python Basics | Python Tutorial | Edureka
Edureka!
 
PPTX
Python Basics
Adheetha O. V
 
PPTX
Beginning Python Programming
St. Petersburg College
 
PDF
Python tutorial
Vijay Chaitanya
 
PDF
Introduction To Python | Edureka
Edureka!
 
PDF
Python made easy
Abhishek kumar
 
PPTX
Python Libraries and Modules
RaginiJain21
 
PDF
Python Programming Tutorial | Edureka
Edureka!
 
PPTX
Basics of python
SurjeetSinghSurjeetS
 
PDF
Fundamentals of python
BijuAugustian
 
PDF
Zero to Hero - Introduction to Python3
Chariza Pladin
 
PDF
Python Course | Python Programming | Python Tutorial | Python Training | Edureka
Edureka!
 
PDF
Python Tutorial For Beginners | Python Crash Course - Python Programming Lang...
Edureka!
 
PPTX
Python 3 Programming Language
Tahani Al-Manie
 
PDF
Introduction to IPython & Jupyter Notebooks
Eueung Mulyana
 
PPTX
Python in 30 minutes!
Fariz Darari
 
PPT
Introduction to Python
amiable_indian
 
Chapter 2 Decision Making (Python Programming Lecture)
IoT Code Lab
 
Chapter 1 Basic Programming (Python Programming Lecture)
IoT Code Lab
 
Python programming
Ashwin Kumar Ramasamy
 
Python Basics | Python Tutorial | Edureka
Edureka!
 
Python Basics
Adheetha O. V
 
Beginning Python Programming
St. Petersburg College
 
Python tutorial
Vijay Chaitanya
 
Introduction To Python | Edureka
Edureka!
 
Python made easy
Abhishek kumar
 
Python Libraries and Modules
RaginiJain21
 
Python Programming Tutorial | Edureka
Edureka!
 
Basics of python
SurjeetSinghSurjeetS
 
Fundamentals of python
BijuAugustian
 
Zero to Hero - Introduction to Python3
Chariza Pladin
 
Python Course | Python Programming | Python Tutorial | Python Training | Edureka
Edureka!
 
Python Tutorial For Beginners | Python Crash Course - Python Programming Lang...
Edureka!
 
Python 3 Programming Language
Tahani Al-Manie
 
Introduction to IPython & Jupyter Notebooks
Eueung Mulyana
 
Python in 30 minutes!
Fariz Darari
 
Introduction to Python
amiable_indian
 
Ad

Similar to Chapter 0 Python Overview (Python Programming Lecture) (20)

PDF
Day 1 - Python Overview and Basic Programming - Python Programming Camp - One...
One Year Programming
 
PPTX
Lecture 0 python basic (ewurc)
Al-Mamun Riyadh (Mun)
 
PPTX
1. Python Programming Basic1bbbbbbbbbbbbbbbb.pptx
2022339027
 
PPTX
Python-Beginer-PartOnePython is one of the top programming languages in the w...
ahmedosman389
 
PDF
What is Python.pdf
PDeepalakshmi1
 
PDF
Python basics_ part1
Elaf A.Saeed
 
PPTX
Python programming workshop session 1
Abdul Haseeb
 
ODP
Hands on Session on Python
Sumit Raj
 
PPTX
Python basics
RANAALIMAJEEDRAJPUT
 
PPTX
Lecture1_introduction to python.pptx
MohammedAlYemeni1
 
PDF
python-online&offline-training-in-kphb-hyderabad (1) (1).pdf
KosmikTech1
 
PPTX
INTRODUCTION TO PYTHON.pptx
Nimrahafzal1
 
PPTX
modul-python-part1.pptx
Yusuf Ayuba
 
PPTX
UNIT-1 : 20ACS04 – PROBLEM SOLVING AND PROGRAMMING USING PYTHON
Nandakumar P
 
PPTX
4_Introduction to Python Programming.pptx
Gnanesh12
 
PPTX
python_class.pptx
chandankumar943868
 
PPTX
Python knowledge ,......................
sabith777a
 
PDF
Python (3).pdf
samiwaris2
 
PPTX
Python Basics by Akanksha Bali
Akanksha Bali
 
PPTX
Introduction-to-Python.pptx grade 9 ICT.
NeilIvanCasas1
 
Day 1 - Python Overview and Basic Programming - Python Programming Camp - One...
One Year Programming
 
Lecture 0 python basic (ewurc)
Al-Mamun Riyadh (Mun)
 
1. Python Programming Basic1bbbbbbbbbbbbbbbb.pptx
2022339027
 
Python-Beginer-PartOnePython is one of the top programming languages in the w...
ahmedosman389
 
What is Python.pdf
PDeepalakshmi1
 
Python basics_ part1
Elaf A.Saeed
 
Python programming workshop session 1
Abdul Haseeb
 
Hands on Session on Python
Sumit Raj
 
Python basics
RANAALIMAJEEDRAJPUT
 
Lecture1_introduction to python.pptx
MohammedAlYemeni1
 
python-online&offline-training-in-kphb-hyderabad (1) (1).pdf
KosmikTech1
 
INTRODUCTION TO PYTHON.pptx
Nimrahafzal1
 
modul-python-part1.pptx
Yusuf Ayuba
 
UNIT-1 : 20ACS04 – PROBLEM SOLVING AND PROGRAMMING USING PYTHON
Nandakumar P
 
4_Introduction to Python Programming.pptx
Gnanesh12
 
python_class.pptx
chandankumar943868
 
Python knowledge ,......................
sabith777a
 
Python (3).pdf
samiwaris2
 
Python Basics by Akanksha Bali
Akanksha Bali
 
Introduction-to-Python.pptx grade 9 ICT.
NeilIvanCasas1
 
Ad

More from IoT Code Lab (8)

PDF
7.1 html lec 7
IoT Code Lab
 
PDF
6.1 html lec 6
IoT Code Lab
 
PDF
5.1 html lec 5
IoT Code Lab
 
PDF
4.1 html lec 4
IoT Code Lab
 
PDF
3.1 html lec 3
IoT Code Lab
 
PDF
2.1 html lec 2
IoT Code Lab
 
PDF
1.1 html lec 1
IoT Code Lab
 
PDF
1.0 intro
IoT Code Lab
 
7.1 html lec 7
IoT Code Lab
 
6.1 html lec 6
IoT Code Lab
 
5.1 html lec 5
IoT Code Lab
 
4.1 html lec 4
IoT Code Lab
 
3.1 html lec 3
IoT Code Lab
 
2.1 html lec 2
IoT Code Lab
 
1.1 html lec 1
IoT Code Lab
 
1.0 intro
IoT Code Lab
 

Recently uploaded (20)

PPTX
PREVENTIVE PEDIATRIC. pptx
AneetaSharma15
 
PDF
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
PPTX
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
PPTX
Introduction to pediatric nursing in 5th Sem..pptx
AneetaSharma15
 
PPTX
Kanban Cards _ Mass Action in Odoo 18.2 - Odoo Slides
Celine George
 
PPTX
CDH. pptx
AneetaSharma15
 
PPTX
Care of patients with elImination deviation.pptx
AneetaSharma15
 
PDF
Study Material and notes for Women Empowerment
ComputerScienceSACWC
 
PDF
Phylum Arthropoda: Characteristics and Classification, Entomology Lecture
Miraj Khan
 
PPTX
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 
PDF
Review of Related Literature & Studies.pdf
Thelma Villaflores
 
DOCX
SAROCES Action-Plan FOR ARAL PROGRAM IN DEPED
Levenmartlacuna1
 
PDF
The Picture of Dorian Gray summary and depiction
opaliyahemel
 
PPTX
Information Texts_Infographic on Forgetting Curve.pptx
Tata Sevilla
 
PPTX
An introduction to Dialogue writing.pptx
drsiddhantnagine
 
PPTX
FSSAI (Food Safety and Standards Authority of India) & FDA (Food and Drug Adm...
Dr. Paindla Jyothirmai
 
DOCX
Unit 5: Speech-language and swallowing disorders
JELLA VISHNU DURGA PRASAD
 
PDF
2.Reshaping-Indias-Political-Map.ppt/pdf/8th class social science Exploring S...
Sandeep Swamy
 
PDF
Health-The-Ultimate-Treasure (1).pdf/8th class science curiosity /samyans edu...
Sandeep Swamy
 
PPTX
An introduction to Prepositions for beginners.pptx
drsiddhantnagine
 
PREVENTIVE PEDIATRIC. pptx
AneetaSharma15
 
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
Introduction to pediatric nursing in 5th Sem..pptx
AneetaSharma15
 
Kanban Cards _ Mass Action in Odoo 18.2 - Odoo Slides
Celine George
 
CDH. pptx
AneetaSharma15
 
Care of patients with elImination deviation.pptx
AneetaSharma15
 
Study Material and notes for Women Empowerment
ComputerScienceSACWC
 
Phylum Arthropoda: Characteristics and Classification, Entomology Lecture
Miraj Khan
 
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 
Review of Related Literature & Studies.pdf
Thelma Villaflores
 
SAROCES Action-Plan FOR ARAL PROGRAM IN DEPED
Levenmartlacuna1
 
The Picture of Dorian Gray summary and depiction
opaliyahemel
 
Information Texts_Infographic on Forgetting Curve.pptx
Tata Sevilla
 
An introduction to Dialogue writing.pptx
drsiddhantnagine
 
FSSAI (Food Safety and Standards Authority of India) & FDA (Food and Drug Adm...
Dr. Paindla Jyothirmai
 
Unit 5: Speech-language and swallowing disorders
JELLA VISHNU DURGA PRASAD
 
2.Reshaping-Indias-Political-Map.ppt/pdf/8th class social science Exploring S...
Sandeep Swamy
 
Health-The-Ultimate-Treasure (1).pdf/8th class science curiosity /samyans edu...
Sandeep Swamy
 
An introduction to Prepositions for beginners.pptx
drsiddhantnagine
 

Chapter 0 Python Overview (Python Programming Lecture)