SlideShare a Scribd company logo
Python
Keep calm it’s python
Below are some facts about Python.
> Python is a widely used general-purpose, high
level programming language.
> Python allows programming in Object Oriented
and Procedural paradigms.
> Python programs generally are smaller than other
programming languages like Java.
> Programmers have to type relatively less and
identation requirement of the language, makes them
readable all the time.
The biggest strength of the Python is large
libarary which can be used for the following
• Machine Learning
• GUI Applications
• Web frameworks like Django (used by YouTube)
• Multimedia
• Image processing
• Test frameworks
• Web scraping
• Scientific computing
• Text processing and many more..
Python Language Introduction
• Python is a widely used general-purpose, high level
programming language. It was initially designed by Guido
van Rossum in 1991 and developed by Python Software
Foundation. It was mainly developed for emphasis on code
readability, and its syntax allows programmers to express
concepts in fewer lines of code.
There are two major Python versions- Python 2
and Python 3. Both are quite different.
• 1) Finding an Interpreter:
• Before we start Python programming, we need to have an interpreter
to interpret and run our programs. There are certain online
interpreters like http://ideone.com/ or http://codepad.org/ that can
be used to start Python without installing an interpreter
• Windows: There are many interpreters available freely to run Python
scripts like IDLE ( Integrated Development Environment ) which is
installed when you install the python software
from http://python.org/
• Linux: For Linux, Python comes bundled with the linux.
Writing first program:
• print(“Hello world my name is piyush rai”)
• We can comment python using #
DATA STRUCTURE AND PYTHON
• In other programming languages like C, C++ and Java,
you will need to declare the type of variables but in
Python you don’t need to do that.
• Just type in the variable and when values will be
given to it, then it will automatically know whether
the value given would be a int, float or char or even a
String.
LIST
• Is the most basic Data Structure in python. List is
mutable data structure i.e items can be added to list
later after the list creation.
• Its like you are going to shop at local market and
made a list of some items and later on you can add
more and more items to the list.
Input and Output
•Now, we will learn how to take input from
the user and hence manipulate it or simply
display it.
•input() function is used to take input from
the user.
Selection
• Selection in Python is made using the two keywords ‘if’
• and
• ‘elif’ and
• else (elseif)
Functions
•You can think of functions like a bunch of
code that is intended to do a particular task
in the whole Python script.
• Python used the keyword ‘def’ to define a
function.
• Now as we know any program starts from a ‘main’
function…lets create a main function like in many other
programming languages.
Iteration Looping
•As the name suggests it calls repeating
things again and again. We will use the most
popular ‘for’ loop here.
Modules
• Python has a very rich module library that has several
functions to do many tasks. You can read more about
Python’s standard library on python.org
• ‘import’ keyword is used to import a particular
module into your python code. For instance consider
the following program.
Python vs Java
Python Java
Dynamically Typed1.No need to declare
anything. An assignment statement binds a
name to an object, and the object can be of
any type.2.No type casting required when
using container objects
Statically Typed 1.All variable names (along
with their types) must be explicitly declared.
Attempting to assign an object of the wrong
type to a variable name triggers a type
exception.2.Type casting is required when
using container objects.
Concise Express much in limited
words
Verbose Contains more words
Compact Less Compact
Uses Indentation for structuring code Uses braces for structuring code
Important differences between Python 2.x
and Python 3.x with examples
• Division operator
• print function
• Unicode
• xrange
• Error Handling
• _future_ module
Keywords in Python
• Python Keywords – Introduction
• This article aims at providing a detailed insight to these
keywords.
• 1. True : This keyword is used to represent a boolean
true. If a statement is true, “True” is printed.
• 2. False : This keyword is used to represent a boolean
false. If a statement is false, “False” is printed.
True and False in python are same as 1 and 0.
Example:
3. None : This is a special constant used to denote a null
value or a void. Its important to remember, 0, any empty
container(e.g empty list) do not compute to None.
It is an object of its own datatype – NoneType. It is not
possible to create multiple None objects and can assign it to
variables.
4. and : This a logical operator in python. “and” Return the
first false value .if not found return last. The truth table for
“and” is depicted below.
5. or : This a logical operator in python. “or” Return
the first True value.if not found return last.The truth
table for “or” is depicted below
6. not : This logical operator inverts the truth
value. The truth table for “not” is depicted
below.
More About input in python
• We can also type cast this input to integer, float or string by
specifying the input() function inside the type.
• Typecasting the input to Integer: There might be conditions
when you might require integer input from user/Console,
the following code takes two input(integer/float) from
console and typecasts them to integer then prints the sum.
• Typecasting the input to Float: To convert the input to float
the following code will work out.
• Typecasting the input to String: All kind of input can be
converted to string type whether they are float or integer.
We make use of keyword str for typecasting.
Taking multiple inputs from user
in Python
Ad

More Related Content

What's hot (20)

Programming
ProgrammingProgramming
Programming
monishagoyal4
 
Seminar report on python 3 course
Seminar report on python 3 courseSeminar report on python 3 course
Seminar report on python 3 course
HimanshuPanwar38
 
Introduction to-python
Introduction to-pythonIntroduction to-python
Introduction to-python
Aakashdata
 
Python quick guide1
Python quick guide1Python quick guide1
Python quick guide1
Kanchilug
 
Seminar report On Python
Seminar report On PythonSeminar report On Python
Seminar report On Python
Shivam Gupta
 
PYTHON CURRENT TREND APPLICATIONS- AN OVERVIEW
PYTHON CURRENT TREND APPLICATIONS- AN OVERVIEWPYTHON CURRENT TREND APPLICATIONS- AN OVERVIEW
PYTHON CURRENT TREND APPLICATIONS- AN OVERVIEW
EditorIJAERD
 
Best Python Online Training with Live Project by Expert
Best Python Online Training with Live Project by Expert Best Python Online Training with Live Project by Expert
Best Python Online Training with Live Project by Expert
QA TrainingHub
 
Python Intro
Python IntroPython Intro
Python Intro
Tim Penhey
 
Python Programming ppt
Python Programming pptPython Programming ppt
Python Programming ppt
ismailmrribi
 
Intro to Python for Non-Programmers
Intro to Python for Non-ProgrammersIntro to Python for Non-Programmers
Intro to Python for Non-Programmers
Ahmad Alhour
 
Python Workshop
Python WorkshopPython Workshop
Python Workshop
Saket Choudhary
 
Intro to Python
Intro to PythonIntro to Python
Intro to Python
primeteacher32
 
Python tutorial
Python tutorialPython tutorial
Python tutorial
Vijay Chaitanya
 
Beginning Python Programming
Beginning Python ProgrammingBeginning Python Programming
Beginning Python Programming
St. Petersburg College
 
Python - An Introduction
Python - An IntroductionPython - An Introduction
Python - An Introduction
Swarit Wadhe
 
Python Tutorial Part 2
Python Tutorial Part 2Python Tutorial Part 2
Python Tutorial Part 2
Haitham El-Ghareeb
 
Python and its Applications
Python and its ApplicationsPython and its Applications
Python and its Applications
Abhijeet Singh
 
summer training report on python
summer training report on pythonsummer training report on python
summer training report on python
Shubham Yadav
 
Python Crash Course
Python Crash CoursePython Crash Course
Python Crash Course
Haim Michael
 
Python final ppt
Python final pptPython final ppt
Python final ppt
Ripal Ranpara
 
Seminar report on python 3 course
Seminar report on python 3 courseSeminar report on python 3 course
Seminar report on python 3 course
HimanshuPanwar38
 
Introduction to-python
Introduction to-pythonIntroduction to-python
Introduction to-python
Aakashdata
 
Python quick guide1
Python quick guide1Python quick guide1
Python quick guide1
Kanchilug
 
Seminar report On Python
Seminar report On PythonSeminar report On Python
Seminar report On Python
Shivam Gupta
 
PYTHON CURRENT TREND APPLICATIONS- AN OVERVIEW
PYTHON CURRENT TREND APPLICATIONS- AN OVERVIEWPYTHON CURRENT TREND APPLICATIONS- AN OVERVIEW
PYTHON CURRENT TREND APPLICATIONS- AN OVERVIEW
EditorIJAERD
 
Best Python Online Training with Live Project by Expert
Best Python Online Training with Live Project by Expert Best Python Online Training with Live Project by Expert
Best Python Online Training with Live Project by Expert
QA TrainingHub
 
Python Programming ppt
Python Programming pptPython Programming ppt
Python Programming ppt
ismailmrribi
 
Intro to Python for Non-Programmers
Intro to Python for Non-ProgrammersIntro to Python for Non-Programmers
Intro to Python for Non-Programmers
Ahmad Alhour
 
Python - An Introduction
Python - An IntroductionPython - An Introduction
Python - An Introduction
Swarit Wadhe
 
Python and its Applications
Python and its ApplicationsPython and its Applications
Python and its Applications
Abhijeet Singh
 
summer training report on python
summer training report on pythonsummer training report on python
summer training report on python
Shubham Yadav
 
Python Crash Course
Python Crash CoursePython Crash Course
Python Crash Course
Haim Michael
 

Similar to Python intro (20)

Programming with Python: Week 1
Programming with Python: Week 1Programming with Python: Week 1
Programming with Python: Week 1
Ahmet Bulut
 
web programming UNIT VIII python by Bhavsingh Maloth
web programming UNIT VIII python by Bhavsingh Malothweb programming UNIT VIII python by Bhavsingh Maloth
web programming UNIT VIII python by Bhavsingh Maloth
Bhavsingh Maloth
 
Python PPT.pptx
Python PPT.pptxPython PPT.pptx
Python PPT.pptx
JosephMuez2
 
Python Demo.pptx
Python Demo.pptxPython Demo.pptx
Python Demo.pptx
ParveenShaik21
 
Python Demo.pptx
Python Demo.pptxPython Demo.pptx
Python Demo.pptx
ParveenShaik21
 
Getting started with the basics of python
Getting started with the basics of pythonGetting started with the basics of python
Getting started with the basics of python
asharjavidaj
 
Tutorial on-python-programming
Tutorial on-python-programmingTutorial on-python-programming
Tutorial on-python-programming
Chetan Giridhar
 
Python (3).pdf
Python (3).pdfPython (3).pdf
Python (3).pdf
samiwaris2
 
Fundamentals of python
Fundamentals of pythonFundamentals of python
Fundamentals of python
BijuAugustian
 
Python 01.pptx
Python 01.pptxPython 01.pptx
Python 01.pptx
AliMohammadAmiri
 
Python for katana
Python for katanaPython for katana
Python for katana
kedar nath
 
Python Module-1.1.pdf
Python Module-1.1.pdfPython Module-1.1.pdf
Python Module-1.1.pdf
4HG19EC010HARSHITHAH
 
Python presentation of Government Engineering College Aurangabad, Bihar
Python presentation of Government Engineering College Aurangabad, BiharPython presentation of Government Engineering College Aurangabad, Bihar
Python presentation of Government Engineering College Aurangabad, Bihar
UttamKumar617567
 
Q-Step_WS_02102019_Practical_introduction_to_Python.pptx
Q-Step_WS_02102019_Practical_introduction_to_Python.pptxQ-Step_WS_02102019_Practical_introduction_to_Python.pptx
Q-Step_WS_02102019_Practical_introduction_to_Python.pptx
nyomans1
 
Q-SPractical_introduction_to_Python.pptx
Q-SPractical_introduction_to_Python.pptxQ-SPractical_introduction_to_Python.pptx
Q-SPractical_introduction_to_Python.pptx
JeromeTacata3
 
Introduction to Python Programing
Introduction to Python ProgramingIntroduction to Python Programing
Introduction to Python Programing
sameer patil
 
Introduction to Python – Learn Python Programming.pptx
Introduction to Python – Learn Python Programming.pptxIntroduction to Python – Learn Python Programming.pptx
Introduction to Python – Learn Python Programming.pptx
HassanShah396906
 
Python Programming 1.pptx
Python Programming 1.pptxPython Programming 1.pptx
Python Programming 1.pptx
Francis Densil Raj
 
Python Programming.pptx
Python Programming.pptxPython Programming.pptx
Python Programming.pptx
DineshThakur911173
 
Python_Programming_PPT Basics of python programming language
Python_Programming_PPT   Basics of python programming languagePython_Programming_PPT   Basics of python programming language
Python_Programming_PPT Basics of python programming language
earningmoney9595
 
Programming with Python: Week 1
Programming with Python: Week 1Programming with Python: Week 1
Programming with Python: Week 1
Ahmet Bulut
 
web programming UNIT VIII python by Bhavsingh Maloth
web programming UNIT VIII python by Bhavsingh Malothweb programming UNIT VIII python by Bhavsingh Maloth
web programming UNIT VIII python by Bhavsingh Maloth
Bhavsingh Maloth
 
Getting started with the basics of python
Getting started with the basics of pythonGetting started with the basics of python
Getting started with the basics of python
asharjavidaj
 
Tutorial on-python-programming
Tutorial on-python-programmingTutorial on-python-programming
Tutorial on-python-programming
Chetan Giridhar
 
Python (3).pdf
Python (3).pdfPython (3).pdf
Python (3).pdf
samiwaris2
 
Fundamentals of python
Fundamentals of pythonFundamentals of python
Fundamentals of python
BijuAugustian
 
Python for katana
Python for katanaPython for katana
Python for katana
kedar nath
 
Python presentation of Government Engineering College Aurangabad, Bihar
Python presentation of Government Engineering College Aurangabad, BiharPython presentation of Government Engineering College Aurangabad, Bihar
Python presentation of Government Engineering College Aurangabad, Bihar
UttamKumar617567
 
Q-Step_WS_02102019_Practical_introduction_to_Python.pptx
Q-Step_WS_02102019_Practical_introduction_to_Python.pptxQ-Step_WS_02102019_Practical_introduction_to_Python.pptx
Q-Step_WS_02102019_Practical_introduction_to_Python.pptx
nyomans1
 
Q-SPractical_introduction_to_Python.pptx
Q-SPractical_introduction_to_Python.pptxQ-SPractical_introduction_to_Python.pptx
Q-SPractical_introduction_to_Python.pptx
JeromeTacata3
 
Introduction to Python Programing
Introduction to Python ProgramingIntroduction to Python Programing
Introduction to Python Programing
sameer patil
 
Introduction to Python – Learn Python Programming.pptx
Introduction to Python – Learn Python Programming.pptxIntroduction to Python – Learn Python Programming.pptx
Introduction to Python – Learn Python Programming.pptx
HassanShah396906
 
Python_Programming_PPT Basics of python programming language
Python_Programming_PPT   Basics of python programming languagePython_Programming_PPT   Basics of python programming language
Python_Programming_PPT Basics of python programming language
earningmoney9595
 
Ad

Recently uploaded (20)

GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
Biophysics Chapter 3 Methods of Studying Macromolecules.pdf
Biophysics Chapter 3 Methods of Studying Macromolecules.pdfBiophysics Chapter 3 Methods of Studying Macromolecules.pdf
Biophysics Chapter 3 Methods of Studying Macromolecules.pdf
PKLI-Institute of Nursing and Allied Health Sciences Lahore , Pakistan.
 
Grade 2 - Mathematics - Printable Worksheet
Grade 2 - Mathematics - Printable WorksheetGrade 2 - Mathematics - Printable Worksheet
Grade 2 - Mathematics - Printable Worksheet
Sritoma Majumder
 
One Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learningOne Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learning
momer9505
 
BỘ ĐỀ TUYỂN SINH VÀO LỚP 10 TIẾNG ANH - 25 ĐỀ THI BÁM SÁT CẤU TRÚC MỚI NHẤT, ...
BỘ ĐỀ TUYỂN SINH VÀO LỚP 10 TIẾNG ANH - 25 ĐỀ THI BÁM SÁT CẤU TRÚC MỚI NHẤT, ...BỘ ĐỀ TUYỂN SINH VÀO LỚP 10 TIẾNG ANH - 25 ĐỀ THI BÁM SÁT CẤU TRÚC MỚI NHẤT, ...
BỘ ĐỀ TUYỂN SINH VÀO LỚP 10 TIẾNG ANH - 25 ĐỀ THI BÁM SÁT CẤU TRÚC MỚI NHẤT, ...
Nguyen Thanh Tu Collection
 
Introduction-to-Communication-and-Media-Studies-1736283331.pdf
Introduction-to-Communication-and-Media-Studies-1736283331.pdfIntroduction-to-Communication-and-Media-Studies-1736283331.pdf
Introduction-to-Communication-and-Media-Studies-1736283331.pdf
james5028
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-3-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 5-3-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 5-3-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-3-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
Link your Lead Opportunities into Spreadsheet using odoo CRM
Link your Lead Opportunities into Spreadsheet using odoo CRMLink your Lead Opportunities into Spreadsheet using odoo CRM
Link your Lead Opportunities into Spreadsheet using odoo CRM
Celine George
 
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptxSCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
Ronisha Das
 
APM Midlands Region April 2025 Sacha Hind Circulated.pdf
APM Midlands Region April 2025 Sacha Hind Circulated.pdfAPM Midlands Region April 2025 Sacha Hind Circulated.pdf
APM Midlands Region April 2025 Sacha Hind Circulated.pdf
Association for Project Management
 
Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
How to Manage Purchase Alternatives in Odoo 18
How to Manage Purchase Alternatives in Odoo 18How to Manage Purchase Alternatives in Odoo 18
How to Manage Purchase Alternatives in Odoo 18
Celine George
 
Odoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo SlidesOdoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo Slides
Celine George
 
Kenan Fellows Participants, Projects 2025-26 Cohort
Kenan Fellows Participants, Projects 2025-26 CohortKenan Fellows Participants, Projects 2025-26 Cohort
Kenan Fellows Participants, Projects 2025-26 Cohort
EducationNC
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulsepulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
sushreesangita003
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
Grade 2 - Mathematics - Printable Worksheet
Grade 2 - Mathematics - Printable WorksheetGrade 2 - Mathematics - Printable Worksheet
Grade 2 - Mathematics - Printable Worksheet
Sritoma Majumder
 
One Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learningOne Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learning
momer9505
 
BỘ ĐỀ TUYỂN SINH VÀO LỚP 10 TIẾNG ANH - 25 ĐỀ THI BÁM SÁT CẤU TRÚC MỚI NHẤT, ...
BỘ ĐỀ TUYỂN SINH VÀO LỚP 10 TIẾNG ANH - 25 ĐỀ THI BÁM SÁT CẤU TRÚC MỚI NHẤT, ...BỘ ĐỀ TUYỂN SINH VÀO LỚP 10 TIẾNG ANH - 25 ĐỀ THI BÁM SÁT CẤU TRÚC MỚI NHẤT, ...
BỘ ĐỀ TUYỂN SINH VÀO LỚP 10 TIẾNG ANH - 25 ĐỀ THI BÁM SÁT CẤU TRÚC MỚI NHẤT, ...
Nguyen Thanh Tu Collection
 
Introduction-to-Communication-and-Media-Studies-1736283331.pdf
Introduction-to-Communication-and-Media-Studies-1736283331.pdfIntroduction-to-Communication-and-Media-Studies-1736283331.pdf
Introduction-to-Communication-and-Media-Studies-1736283331.pdf
james5028
 
Link your Lead Opportunities into Spreadsheet using odoo CRM
Link your Lead Opportunities into Spreadsheet using odoo CRMLink your Lead Opportunities into Spreadsheet using odoo CRM
Link your Lead Opportunities into Spreadsheet using odoo CRM
Celine George
 
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptxSCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
Ronisha Das
 
Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
How to Manage Purchase Alternatives in Odoo 18
How to Manage Purchase Alternatives in Odoo 18How to Manage Purchase Alternatives in Odoo 18
How to Manage Purchase Alternatives in Odoo 18
Celine George
 
Odoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo SlidesOdoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo Slides
Celine George
 
Kenan Fellows Participants, Projects 2025-26 Cohort
Kenan Fellows Participants, Projects 2025-26 CohortKenan Fellows Participants, Projects 2025-26 Cohort
Kenan Fellows Participants, Projects 2025-26 Cohort
EducationNC
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulsepulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
sushreesangita003
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
Ad

Python intro

  • 2. Below are some facts about Python. > Python is a widely used general-purpose, high level programming language. > Python allows programming in Object Oriented and Procedural paradigms. > Python programs generally are smaller than other programming languages like Java. > Programmers have to type relatively less and identation requirement of the language, makes them readable all the time.
  • 3. The biggest strength of the Python is large libarary which can be used for the following • Machine Learning • GUI Applications • Web frameworks like Django (used by YouTube) • Multimedia • Image processing • Test frameworks • Web scraping • Scientific computing • Text processing and many more..
  • 4. Python Language Introduction • Python is a widely used general-purpose, high level programming language. It was initially designed by Guido van Rossum in 1991 and developed by Python Software Foundation. It was mainly developed for emphasis on code readability, and its syntax allows programmers to express concepts in fewer lines of code.
  • 5. There are two major Python versions- Python 2 and Python 3. Both are quite different. • 1) Finding an Interpreter: • Before we start Python programming, we need to have an interpreter to interpret and run our programs. There are certain online interpreters like http://ideone.com/ or http://codepad.org/ that can be used to start Python without installing an interpreter • Windows: There are many interpreters available freely to run Python scripts like IDLE ( Integrated Development Environment ) which is installed when you install the python software from http://python.org/ • Linux: For Linux, Python comes bundled with the linux.
  • 6. Writing first program: • print(“Hello world my name is piyush rai”) • We can comment python using #
  • 7. DATA STRUCTURE AND PYTHON • In other programming languages like C, C++ and Java, you will need to declare the type of variables but in Python you don’t need to do that. • Just type in the variable and when values will be given to it, then it will automatically know whether the value given would be a int, float or char or even a String.
  • 8. LIST • Is the most basic Data Structure in python. List is mutable data structure i.e items can be added to list later after the list creation. • Its like you are going to shop at local market and made a list of some items and later on you can add more and more items to the list.
  • 9. Input and Output •Now, we will learn how to take input from the user and hence manipulate it or simply display it. •input() function is used to take input from the user.
  • 10. Selection • Selection in Python is made using the two keywords ‘if’ • and • ‘elif’ and • else (elseif)
  • 11. Functions •You can think of functions like a bunch of code that is intended to do a particular task in the whole Python script. • Python used the keyword ‘def’ to define a function. • Now as we know any program starts from a ‘main’ function…lets create a main function like in many other programming languages.
  • 12. Iteration Looping •As the name suggests it calls repeating things again and again. We will use the most popular ‘for’ loop here.
  • 13. Modules • Python has a very rich module library that has several functions to do many tasks. You can read more about Python’s standard library on python.org • ‘import’ keyword is used to import a particular module into your python code. For instance consider the following program.
  • 14. Python vs Java Python Java Dynamically Typed1.No need to declare anything. An assignment statement binds a name to an object, and the object can be of any type.2.No type casting required when using container objects Statically Typed 1.All variable names (along with their types) must be explicitly declared. Attempting to assign an object of the wrong type to a variable name triggers a type exception.2.Type casting is required when using container objects. Concise Express much in limited words Verbose Contains more words Compact Less Compact Uses Indentation for structuring code Uses braces for structuring code
  • 15. Important differences between Python 2.x and Python 3.x with examples • Division operator • print function • Unicode • xrange • Error Handling • _future_ module
  • 16. Keywords in Python • Python Keywords – Introduction • This article aims at providing a detailed insight to these keywords. • 1. True : This keyword is used to represent a boolean true. If a statement is true, “True” is printed. • 2. False : This keyword is used to represent a boolean false. If a statement is false, “False” is printed. True and False in python are same as 1 and 0. Example:
  • 17. 3. None : This is a special constant used to denote a null value or a void. Its important to remember, 0, any empty container(e.g empty list) do not compute to None. It is an object of its own datatype – NoneType. It is not possible to create multiple None objects and can assign it to variables. 4. and : This a logical operator in python. “and” Return the first false value .if not found return last. The truth table for “and” is depicted below.
  • 18. 5. or : This a logical operator in python. “or” Return the first True value.if not found return last.The truth table for “or” is depicted below 6. not : This logical operator inverts the truth value. The truth table for “not” is depicted below.
  • 19. More About input in python • We can also type cast this input to integer, float or string by specifying the input() function inside the type. • Typecasting the input to Integer: There might be conditions when you might require integer input from user/Console, the following code takes two input(integer/float) from console and typecasts them to integer then prints the sum. • Typecasting the input to Float: To convert the input to float the following code will work out. • Typecasting the input to String: All kind of input can be converted to string type whether they are float or integer. We make use of keyword str for typecasting.
  • 20. Taking multiple inputs from user in Python