SlideShare a Scribd company logo
Lecture 0 python basic (ewurc)
Python
Lecture 0
Problem Set 0: Basic
Topic
• Installation
• Hello World
• Input/ Output
• Variable (+Naming Convention)
• Data Type
• Type Casting
• Built in Function
• Problem Set 0: Basic (6)
Lecture 0 python basic (ewurc)
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
# First Python Program
# Program Name: Hello World
# Author Name: Mun Al Mamun
# A Program to Print a text
print("Hello World")
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 1 (Con.)[Data Type]
#input a String
name = input("Input Your Name: ")
print(name)
print(type(name))
Input Your Name
# input a String
#print("Input Your Name")
name = input("Input Your Name: ")
#name = input()
print(name)
#print(type(name))
Variable (+ Naming Convention) The Rules
• https://www.python.org/dev/peps/pep-0008/#naming-conventions
• lowercase_underscore for functions, methods, attributes, variables
• lowercase_underscore or ALL_CAPS for constants
• PascalCase for classes
• camelCase only to conform to pre-existing conventions
• _underscore for non-public methods and instance variables
Input an Integer Number
age = input()
print(age)
Input an Integer Number [2]
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 [3 (no way)]
age = input()
print(type(age))
print(age)
age = int(age)
print(age)
print(type(age))
Input an Integer Number [3] [Final]
age = int(input())
print(type(age))
print(age)
print(type(age))
Input an Float Number
cgpa = input()
print(cgpa)
print(type(cgpa))
Input an Float Number [1 (no way)]
cgpa = input()
print(type(cgpa))
cgpa = float(cgpa)
print(cgpa)
print(type(cgpa))
Input an Float Number [2] [Final]
cgpa = float(input())
print(type(cgpa))
print(cgpa)
print(type(cgpa))
Are you a liar? [1]
you = True
print(you)
print(type(you))
Are you a liar? [2]
you = False
print(you)
print(type(you))
Formatted I/O
#Input Name with Formatted Output
name = input("What is Your Name: ")
print("Hello, ",name)
#Input Age with Formatted Output
age = int(input("What is Your Age: "))
print("Your age is: ",age)
#Input CGPA with Formatted Output
cgpa = float(input("What is Your CGPA: "))
print("Your CGPA is ",cgpa)
Formatted I/O
#Input Name with Formatted Output
name = input("What is Your Name: ")
print("Hello, ",name)
print("Hello, ",name, "nHow are You?")
print("Hello, {}".format(name))
print(f"Hello, {name}")
Data Type
• str (String)
• int (Integer)
• float (Float)
• bool (Boolean)
• None (NoneType)
Built-in Function
• print()
• input()
• type()
• int()
• float()
• https://docs.python.org/3.6/library/functions.html
Problem Set 0: Basic (6)
• Hello World.
• IO Your Name.
• IO your Age.
• IO your CGPA.
• Are you a liar? (Boolean)
• Formatted I/O. (String + Numeric) [for Problem 2,3,4]
Online Resourse
• python.org -> Docs -> Tutorial
• YouTube
• Python Tutorials -> Corey Schafer
• Python Beginners Tutorials -> Mahmud Ahsan : Thinkdiff
• Learn Python Programming -> Clever Programmer
• Python 3.5 Basic (Bangla) -> Vubon Roy
• Python Tutorials for Absolute Beginners by CS Dojo -> CS Dojo
Any Question?
Prepared by
Mun Al Mamun
President
East West University Robotics Club
munewu@gmail.com
T h i s s l i d e i s p r o v i d e a s a c o u r s e
m a t e r i a l i n t h e w o r k s h o p
“ W o r k s h o p O n P y t h o n P r o g r a m m i n g ”
O r g a n i z e d b y
E a s t W e s t U n i v e r s i t y R o b o t i c s C l u b

More Related Content

Similar to Lecture 0 python basic (ewurc) (20)

Review 2Pygame made using python programming
Review 2Pygame made using python programmingReview 2Pygame made using python programming
Review 2Pygame made using python programming
ithepacer
 
IoT-Week1-Day1-Lab.pptx
IoT-Week1-Day1-Lab.pptxIoT-Week1-Day1-Lab.pptx
IoT-Week1-Day1-Lab.pptx
afsheenfaiq2
 
Introduction to learn and Python Interpreter
Introduction to learn and Python InterpreterIntroduction to learn and Python Interpreter
Introduction to learn and Python Interpreter
Alamelu
 
Python (Data Analysis) cleaning and visualize
Python (Data Analysis) cleaning and visualizePython (Data Analysis) cleaning and visualize
Python (Data Analysis) cleaning and visualize
IruolagbePius
 
Revision-of-thehki-basics-of-python.pptx
Revision-of-thehki-basics-of-python.pptxRevision-of-thehki-basics-of-python.pptx
Revision-of-thehki-basics-of-python.pptx
PraveenaFppt
 
Python course
Python coursePython course
Python course
Евгений Сазонов
 
PPt Revision of the basics of python1.pptx
PPt Revision of the basics of python1.pptxPPt Revision of the basics of python1.pptx
PPt Revision of the basics of python1.pptx
tcsonline1222
 
The python fundamental introduction part 1
The python fundamental introduction part 1The python fundamental introduction part 1
The python fundamental introduction part 1
DeoDuaNaoHet
 
pyton Notes1
pyton Notes1pyton Notes1
pyton Notes1
Amba Research
 
Python.pptx
Python.pptxPython.pptx
Python.pptx
EliasPetros
 
Keep it Stupidly Simple Introduce Python
Keep it Stupidly Simple Introduce PythonKeep it Stupidly Simple Introduce Python
Keep it Stupidly Simple Introduce Python
SushJalai
 
Review old Pygame made using python programming.pptx
Review old Pygame made using python programming.pptxReview old Pygame made using python programming.pptx
Review old Pygame made using python programming.pptx
ithepacer
 
Python for beginner, learn python from scratch.pptx
Python for beginner,  learn python from scratch.pptxPython for beginner,  learn python from scratch.pptx
Python for beginner, learn python from scratch.pptx
olieee2023
 
Python Workshop - Learn Python the Hard Way
Python Workshop - Learn Python the Hard WayPython Workshop - Learn Python the Hard Way
Python Workshop - Learn Python the Hard Way
Utkarsh Sengar
 
Python in One Shot.docx
Python in One Shot.docxPython in One Shot.docx
Python in One Shot.docx
DeepakSingh710536
 
Python in one shot
Python in one shotPython in one shot
Python in one shot
Gulshan76
 
Python ppt
Python pptPython ppt
Python ppt
GoogleDeveloperStude2
 
An Intro to Python in 30 minutes
An Intro to Python in 30 minutesAn Intro to Python in 30 minutes
An Intro to Python in 30 minutes
Sumit Raj
 
Python for Physical Science.pdf
Python for Physical Science.pdfPython for Physical Science.pdf
Python for Physical Science.pdf
MarilouANDERSON
 
Python real time tutorial
Python real time tutorialPython real time tutorial
Python real time tutorial
Rajeev Kumar
 
Review 2Pygame made using python programming
Review 2Pygame made using python programmingReview 2Pygame made using python programming
Review 2Pygame made using python programming
ithepacer
 
IoT-Week1-Day1-Lab.pptx
IoT-Week1-Day1-Lab.pptxIoT-Week1-Day1-Lab.pptx
IoT-Week1-Day1-Lab.pptx
afsheenfaiq2
 
Introduction to learn and Python Interpreter
Introduction to learn and Python InterpreterIntroduction to learn and Python Interpreter
Introduction to learn and Python Interpreter
Alamelu
 
Python (Data Analysis) cleaning and visualize
Python (Data Analysis) cleaning and visualizePython (Data Analysis) cleaning and visualize
Python (Data Analysis) cleaning and visualize
IruolagbePius
 
Revision-of-thehki-basics-of-python.pptx
Revision-of-thehki-basics-of-python.pptxRevision-of-thehki-basics-of-python.pptx
Revision-of-thehki-basics-of-python.pptx
PraveenaFppt
 
PPt Revision of the basics of python1.pptx
PPt Revision of the basics of python1.pptxPPt Revision of the basics of python1.pptx
PPt Revision of the basics of python1.pptx
tcsonline1222
 
The python fundamental introduction part 1
The python fundamental introduction part 1The python fundamental introduction part 1
The python fundamental introduction part 1
DeoDuaNaoHet
 
Keep it Stupidly Simple Introduce Python
Keep it Stupidly Simple Introduce PythonKeep it Stupidly Simple Introduce Python
Keep it Stupidly Simple Introduce Python
SushJalai
 
Review old Pygame made using python programming.pptx
Review old Pygame made using python programming.pptxReview old Pygame made using python programming.pptx
Review old Pygame made using python programming.pptx
ithepacer
 
Python for beginner, learn python from scratch.pptx
Python for beginner,  learn python from scratch.pptxPython for beginner,  learn python from scratch.pptx
Python for beginner, learn python from scratch.pptx
olieee2023
 
Python Workshop - Learn Python the Hard Way
Python Workshop - Learn Python the Hard WayPython Workshop - Learn Python the Hard Way
Python Workshop - Learn Python the Hard Way
Utkarsh Sengar
 
Python in one shot
Python in one shotPython in one shot
Python in one shot
Gulshan76
 
An Intro to Python in 30 minutes
An Intro to Python in 30 minutesAn Intro to Python in 30 minutes
An Intro to Python in 30 minutes
Sumit Raj
 
Python for Physical Science.pdf
Python for Physical Science.pdfPython for Physical Science.pdf
Python for Physical Science.pdf
MarilouANDERSON
 
Python real time tutorial
Python real time tutorialPython real time tutorial
Python real time tutorial
Rajeev Kumar
 

More from Al-Mamun Riyadh (Mun) (6)

Lecture 1 python arithmetic (ewurc)
Lecture 1 python arithmetic (ewurc)Lecture 1 python arithmetic (ewurc)
Lecture 1 python arithmetic (ewurc)
Al-Mamun Riyadh (Mun)
 
Prime Number (Sieve)
Prime Number (Sieve)Prime Number (Sieve)
Prime Number (Sieve)
Al-Mamun Riyadh (Mun)
 
Workshop on arduino (ewurc)
Workshop on arduino (ewurc)Workshop on arduino (ewurc)
Workshop on arduino (ewurc)
Al-Mamun Riyadh (Mun)
 
Lecture 6 python oop (ewurc)
Lecture 6 python oop (ewurc)Lecture 6 python oop (ewurc)
Lecture 6 python oop (ewurc)
Al-Mamun Riyadh (Mun)
 
Lecture 4 python string (ewurc)
Lecture 4 python string (ewurc)Lecture 4 python string (ewurc)
Lecture 4 python string (ewurc)
Al-Mamun Riyadh (Mun)
 
Lecture 2 python conditional (ewurc)
Lecture 2 python conditional (ewurc)Lecture 2 python conditional (ewurc)
Lecture 2 python conditional (ewurc)
Al-Mamun Riyadh (Mun)
 
Ad

Recently uploaded (20)

Optimization technique in pharmaceutical product development.pptx
Optimization technique in pharmaceutical product development.pptxOptimization technique in pharmaceutical product development.pptx
Optimization technique in pharmaceutical product development.pptx
UrmiPrajapati3
 
What is FIle and explanation of text files.pptx
What is FIle and explanation of text files.pptxWhat is FIle and explanation of text files.pptx
What is FIle and explanation of text files.pptx
Ramakrishna Reddy Bijjam
 
Nice Dream.pdf /
Nice Dream.pdf                              /Nice Dream.pdf                              /
Nice Dream.pdf /
ErinUsher3
 
Respiratory System , Urinary System
Respiratory  System , Urinary SystemRespiratory  System , Urinary System
Respiratory System , Urinary System
RushiMandali
 
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKANMATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
aditya23173
 
EUPHORIA GENERAL QUIZ FINALS | QUIZ CLUB OF PSGCAS | 21 MARCH 2025
EUPHORIA GENERAL QUIZ FINALS | QUIZ CLUB OF PSGCAS | 21 MARCH 2025EUPHORIA GENERAL QUIZ FINALS | QUIZ CLUB OF PSGCAS | 21 MARCH 2025
EUPHORIA GENERAL QUIZ FINALS | QUIZ CLUB OF PSGCAS | 21 MARCH 2025
Quiz Club of PSG College of Arts & Science
 
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
EduSkills OECD
 
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Analysis of Quantitative Data Parametric and non-parametric tests.pptxAnalysis of Quantitative Data Parametric and non-parametric tests.pptx
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Shrutidhara2
 
Basic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Basic English for Communication - Dr Hj Euis Eti Rohaeti MpdBasic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Basic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Restu Bias Primandhika
 
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptxPests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Arshad Shaikh
 
IDF 30min presentation - December 2, 2024.pptx
IDF 30min presentation - December 2, 2024.pptxIDF 30min presentation - December 2, 2024.pptx
IDF 30min presentation - December 2, 2024.pptx
ArneeAgligar
 
MATERI PPT TOPIK 4 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 4 LANDASAN FILOSOFIS PENDIDIKANMATERI PPT TOPIK 4 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 4 LANDASAN FILOSOFIS PENDIDIKAN
aditya23173
 
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition OecdEnergy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
razelitouali
 
TV Shows and web-series quiz | QUIZ CLUB OF PSGCAS | 13TH MARCH 2025
TV Shows and web-series quiz | QUIZ CLUB OF PSGCAS | 13TH MARCH 2025TV Shows and web-series quiz | QUIZ CLUB OF PSGCAS | 13TH MARCH 2025
TV Shows and web-series quiz | QUIZ CLUB OF PSGCAS | 13TH MARCH 2025
Quiz Club of PSG College of Arts & Science
 
Black and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdfBlack and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdf
AnnasofiaUrsini
 
Hemiptera & Neuroptera: Insect Diversity.pptx
Hemiptera & Neuroptera: Insect Diversity.pptxHemiptera & Neuroptera: Insect Diversity.pptx
Hemiptera & Neuroptera: Insect Diversity.pptx
Arshad Shaikh
 
Final Sketch Designs for poster production.pptx
Final Sketch Designs for poster production.pptxFinal Sketch Designs for poster production.pptx
Final Sketch Designs for poster production.pptx
bobby205207
 
SEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptx
SEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptxSEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptx
SEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptx
PoojaSen20
 
Rose Cultivation Practices by Kushal Lamichhane.pdf
Rose Cultivation Practices by Kushal Lamichhane.pdfRose Cultivation Practices by Kushal Lamichhane.pdf
Rose Cultivation Practices by Kushal Lamichhane.pdf
kushallamichhame
 
Gibson "Secrets to Changing Behaviour in Scholarly Communication: A 2025 NISO...
Gibson "Secrets to Changing Behaviour in Scholarly Communication: A 2025 NISO...Gibson "Secrets to Changing Behaviour in Scholarly Communication: A 2025 NISO...
Gibson "Secrets to Changing Behaviour in Scholarly Communication: A 2025 NISO...
National Information Standards Organization (NISO)
 
Optimization technique in pharmaceutical product development.pptx
Optimization technique in pharmaceutical product development.pptxOptimization technique in pharmaceutical product development.pptx
Optimization technique in pharmaceutical product development.pptx
UrmiPrajapati3
 
What is FIle and explanation of text files.pptx
What is FIle and explanation of text files.pptxWhat is FIle and explanation of text files.pptx
What is FIle and explanation of text files.pptx
Ramakrishna Reddy Bijjam
 
Nice Dream.pdf /
Nice Dream.pdf                              /Nice Dream.pdf                              /
Nice Dream.pdf /
ErinUsher3
 
Respiratory System , Urinary System
Respiratory  System , Urinary SystemRespiratory  System , Urinary System
Respiratory System , Urinary System
RushiMandali
 
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKANMATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
aditya23173
 
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
EduSkills OECD
 
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Analysis of Quantitative Data Parametric and non-parametric tests.pptxAnalysis of Quantitative Data Parametric and non-parametric tests.pptx
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Shrutidhara2
 
Basic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Basic English for Communication - Dr Hj Euis Eti Rohaeti MpdBasic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Basic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Restu Bias Primandhika
 
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptxPests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Arshad Shaikh
 
IDF 30min presentation - December 2, 2024.pptx
IDF 30min presentation - December 2, 2024.pptxIDF 30min presentation - December 2, 2024.pptx
IDF 30min presentation - December 2, 2024.pptx
ArneeAgligar
 
MATERI PPT TOPIK 4 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 4 LANDASAN FILOSOFIS PENDIDIKANMATERI PPT TOPIK 4 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 4 LANDASAN FILOSOFIS PENDIDIKAN
aditya23173
 
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition OecdEnergy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
razelitouali
 
Black and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdfBlack and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdf
AnnasofiaUrsini
 
Hemiptera & Neuroptera: Insect Diversity.pptx
Hemiptera & Neuroptera: Insect Diversity.pptxHemiptera & Neuroptera: Insect Diversity.pptx
Hemiptera & Neuroptera: Insect Diversity.pptx
Arshad Shaikh
 
Final Sketch Designs for poster production.pptx
Final Sketch Designs for poster production.pptxFinal Sketch Designs for poster production.pptx
Final Sketch Designs for poster production.pptx
bobby205207
 
SEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptx
SEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptxSEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptx
SEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptx
PoojaSen20
 
Rose Cultivation Practices by Kushal Lamichhane.pdf
Rose Cultivation Practices by Kushal Lamichhane.pdfRose Cultivation Practices by Kushal Lamichhane.pdf
Rose Cultivation Practices by Kushal Lamichhane.pdf
kushallamichhame
 
Ad

Lecture 0 python basic (ewurc)

  • 3. Topic • Installation • Hello World • Input/ Output • Variable (+Naming Convention) • Data Type • Type Casting • Built in Function • Problem Set 0: Basic (6)
  • 5. Create First Python Program File • Python IDLE • File -> New File -> Save (/Save As) -> Hello.py • Write Python Program • Run -> Run Module (F5)
  • 6. Write First Python Program print("Hello World")
  • 7. Comment • # Single Line Comment • """ Multi Line Comment """
  • 8. First Python Program Modified # First Python Program # Program Name: Hello World # Author Name: Mun Al Mamun # A Program to Print a text print("Hello World")
  • 9. Input/ Output 1 # input a String name = input() print(name)
  • 10. Input/ Output 1 (Con.)[Display Message 1] #input a String print("Input Your Name") name = input() print(name)
  • 11. Input/ Output 1 (Con.)[Display Message 2] #input a String name = input("Input Your Name: ") print(name)
  • 12. Input/ Output 1 (Con.)[Data Type] #input a String name = input("Input Your Name: ") print(name) print(type(name))
  • 13. Input Your Name # input a String #print("Input Your Name") name = input("Input Your Name: ") #name = input() print(name) #print(type(name))
  • 14. Variable (+ Naming Convention) The Rules • https://www.python.org/dev/peps/pep-0008/#naming-conventions • lowercase_underscore for functions, methods, attributes, variables • lowercase_underscore or ALL_CAPS for constants • PascalCase for classes • camelCase only to conform to pre-existing conventions • _underscore for non-public methods and instance variables
  • 15. Input an Integer Number age = input() print(age)
  • 16. Input an Integer Number [2] age = input() print(age) print(type(age)) • All Input is String in Python • We have to Type Cast to convert String into Integer.
  • 17. Input an Integer Number [3 (no way)] age = input() print(type(age)) print(age) age = int(age) print(age) print(type(age))
  • 18. Input an Integer Number [3] [Final] age = int(input()) print(type(age)) print(age) print(type(age))
  • 19. Input an Float Number cgpa = input() print(cgpa) print(type(cgpa))
  • 20. Input an Float Number [1 (no way)] cgpa = input() print(type(cgpa)) cgpa = float(cgpa) print(cgpa) print(type(cgpa))
  • 21. Input an Float Number [2] [Final] cgpa = float(input()) print(type(cgpa)) print(cgpa) print(type(cgpa))
  • 22. Are you a liar? [1] you = True print(you) print(type(you))
  • 23. Are you a liar? [2] you = False print(you) print(type(you))
  • 24. Formatted I/O #Input Name with Formatted Output name = input("What is Your Name: ") print("Hello, ",name) #Input Age with Formatted Output age = int(input("What is Your Age: ")) print("Your age is: ",age) #Input CGPA with Formatted Output cgpa = float(input("What is Your CGPA: ")) print("Your CGPA is ",cgpa)
  • 25. Formatted I/O #Input Name with Formatted Output name = input("What is Your Name: ") print("Hello, ",name) print("Hello, ",name, "nHow are You?") print("Hello, {}".format(name)) print(f"Hello, {name}")
  • 26. Data Type • str (String) • int (Integer) • float (Float) • bool (Boolean) • None (NoneType)
  • 27. Built-in Function • print() • input() • type() • int() • float() • https://docs.python.org/3.6/library/functions.html
  • 28. Problem Set 0: Basic (6) • Hello World. • IO Your Name. • IO your Age. • IO your CGPA. • Are you a liar? (Boolean) • Formatted I/O. (String + Numeric) [for Problem 2,3,4]
  • 29. Online Resourse • python.org -> Docs -> Tutorial • YouTube • Python Tutorials -> Corey Schafer • Python Beginners Tutorials -> Mahmud Ahsan : Thinkdiff • Learn Python Programming -> Clever Programmer • Python 3.5 Basic (Bangla) -> Vubon Roy • Python Tutorials for Absolute Beginners by CS Dojo -> CS Dojo
  • 31. Prepared by Mun Al Mamun President East West University Robotics Club [email protected] T h i s s l i d e i s p r o v i d e a s a c o u r s e m a t e r i a l i n t h e w o r k s h o p “ W o r k s h o p O n P y t h o n P r o g r a m m i n g ” O r g a n i z e d b y E a s t W e s t U n i v e r s i t y R o b o t i c s C l u b