SlideShare a Scribd company logo
1 of 14
www.elewayte.com
GET READY TO SSSSSSINK
INTO PYTHON BASICS,
ITS POWER & VERSATILITY
iNTRODUCTION
TO PYTHON
Python is a high-level programming
language that is widely used in various
fields, including data
science, web development, and artificial
intelligence. Some of the key elements of
Python include:
01
DATA TYPES
02
VARIABLES
03
OPERATORS
04
CONDITIONAL
STATEMENTS
05
LOOPS
06
FUNCTIONS
07
LIBRARIES
Data Types:
So Many Flavors, So
Little Time!
In Python, data types are categories of
values that determine how the values
behave and what operations can be
performed on them. Here are some
common data types and their examples:
TYPES DESCRIPTION EXAMPLES
Numeric
Represents numerical
values
'int' , 'float' , 'complex'
Sequence
Represents a collection of
ordered and indexed values
'list' , 'tuple' , 'range'
Text
Represents a sequence of
characters
'str'
Mapping
Represents a collection of
key-value pairs
'dict'
Set
Represents a collection of
unique elements
'set' , 'frozenset'
Boolean
Represents a binary truth
value
'bool'
Binary Represents binary data
'bytes' , 'bytearray' ,
'memoryview'
Examples that shows how different data types can be used in
Python:
Variables:
Party Time! Get
Your Data On!
A variable in Python is just a name that
represents a value, and you can use it to
store and manipulate data throughout
your program.
Let’s understand the same with a small
example:
In Python, we’ll try to create a variable called "age" and
assign a value to it, like this:
Now, whenever you need to use that age value in your
program, you can just use the variable name "age". For
example:
The output will be:
In this example, the variable "age" is assigned the value 15.
Then, the print statement uses the value of the variable
"age" to output the string "I am 15 years old."
Note: We use the str() function to convert the integer value
of "age" into a string, so we can concatenate it with the
other strings in the output statement.
Operators:
Go crazy with
Calculations!
In Python, operators are symbols or
special characters that allow you to
perform different kinds of operations on
variables and values.
Here's a table that summarizes the
different types of operators in Python,
along with their descriptions and
examples:
TYPES DESCRIPTION EXAMPLES
Arithmetic
Operators
Used to perform arithmetic
operations
'2 + 3' returns '5'
Comparison
Operators
Used to compare
values
'2 < 3' returns 'True'
Logical
Operators
Used to combine and
manipulate boolean values
'True and False' returns
'False'
Bitwise
Operators
Used to perform
bitwise operations
'5 & 3' returns '1'
Assignment
Operators
Used to assign values
to variables
'x=5'
Identity
Operators
Used to compare the
memory location of
two objects
'x is y' returns 'True'
Membership
Operators
Used to check if a
value is present in a
sequence
'2 in [1, 2, 3]' return 'True'
Conditional
Statements:
Be the boss of your
code!
Conditional statements in allow you to control
the flow of your program based on certain
conditions. They are used to make decisions in
your code, and they help your program to be
more flexible and responsive to different inputs.
Here's a detailed description along with
examples that demonstrates the different types
of conditional statements in Python to perform
various kinds of checks, such as checking if a
number is greater than a certain value, or if it
falls within a certain range. When you run this
code, you will see the output for each
conditional statement.
TYPES DESCRIPTION EXAMPLES
If
statement
Executes a block
of code if a condition
is true
'x=5' <br>
'if x>3:'<br>
'print("x is greater than 3")'
If else
statement
Executes one block
of code if a condition
is true and another
block if it is false
'x=2' <br>
'if x>3: '<br>
'print("x is greater than 3")' <br>
'else:' <br>
'print("x is less than or equal to 3")'
elif
statement
Executes a block of
code if a condition is true,
and if not, checks
another condition
'x = 5' <br>
'if x > 7: ' <br>
'print("x is
greater than 7")' <br>
'elif x > 3: '<br>
'print("x is greater than 3 but less
than or equal to 7")' <br>
'else:' <br>
'print("x is less than or equal to 3")'
nested if
statement
Executes a block of
code if a condition is true,
and that block
can contain another
if statement
'x = 5' <br>
'if x > 3:' <br>
'if x < 7:' <br>
'print("x is between 3 and7")' <br>
'else:' <br>
'print("x is greater than or equal to 7")' <br>
'else:'<br>
'print("x is less than or equal to 3")'
Loops:
Repeat After Me!
Loops are used to repeat a block of code multiple
times until a certain condition is met. There are
two main types of loops in Python: for loops and
while loops.
Here's an example of a for loop that iterates over
a list of numbers and prints each number along
with the output. In this example, the loop will
continue to run as long as count is greater than
0. Each time the loop runs, it prints the value of
count, then subtracts 1 from it. Eventually, count
becomes 0, and the loop stops running.
There are also other types of loops in Python,
such as nested loops, which allow you to put one
loop inside another, and break and continue
statements, which allow you to control the flow
of the loop.
INPUT OUTPUT
FOR
LOOP
LOOP TYPE DESCRIPTION
'for' loop
Used to iterate over a sequence of elements,
such as a list or string
'while' loop
Used to repeat a block of code while a certain
condition is true
WHILE
LOOP
FUNCTION TYPE DESCRIPTION
Built-in
functions
Functions that are built in python and can be
used without needing to define them.
Examples - 'print()' , 'len()' and 'range()'
User-defined
functions
Functions that you create yourself to perform
a specific task. They can be reused multiple
times throughout your code.
Functions:
The Superheroes
of Code!
Functions are reusable blocks of code that perform
a specific task. They allow you to write a piece of
code once and use it multiple times without having
to rewrite the code. There are two main types of
functions in Python: built-in functions and user-
defined functions.
In this example, we define a function called
add_numbers() that takes two parameters, a and b.
The function adds a and b together and returns the
sum. We then call the function with the values 2
and 3, which returns 5. Finally, we print the result.
INPUT OUTPUT
Built-in
function
User-
defined
function
Functions
Continue...
Here's an example of using the math library to
calculate the square root of a number:
Another example is using the pandas library to
read a CSV file and display its contents:
Python's Top Guns:
The Most Important
Libraries
1. NumPy
NumPy is a library for numerical computing in
Python. It provides fast and efficient array
operations and linear algebra routines.
2. Pandas
Pandas is a library for data manipulation
and analysis in Python. It provides
powerful tools for working with structured
data, such as dataframes and series.
Example for importing NumPy
Library in Python
Example for importing Pandas
Library in Python
Libraries
Continue...
Matplotlib is a library for data visualization
in Python. It provides a variety of plots and
charts for visualizing data, including line
plots, scatter plots, and histograms.
Scikit-learn is a library for machine
learning in Python. It provides tools for
data preprocessing, model selection, and
evaluation, as well as a range of machine
learning algorithms.
Example for importing
Matplotlib Library in Python
Example for importing Scikit-
learn library in Python
3. Matplotlib
4. Scikit-learn
FOLLOW FOR MORE
SUCH CONTENTS
www.elewayte.com
elewayte_edu Elewayte Elewayte
elewayte_

More Related Content

What's hot

Introduction to python programming
Introduction to python programmingIntroduction to python programming
Introduction to python programmingSrinivas Narasegouda
 
Python Course | Python Programming | Python Tutorial | Python Training | Edureka
Python Course | Python Programming | Python Tutorial | Python Training | EdurekaPython Course | Python Programming | Python Tutorial | Python Training | Edureka
Python Course | Python Programming | Python Tutorial | Python Training | EdurekaEdureka!
 
1.python interpreter and interactive mode
1.python interpreter and interactive mode1.python interpreter and interactive mode
1.python interpreter and interactive modeManjuA8
 
Intro to Python for Non-Programmers
Intro to Python for Non-ProgrammersIntro to Python for Non-Programmers
Intro to Python for Non-ProgrammersAhmad Alhour
 
Python Tutorial | Python Tutorial for Beginners | Python Training | Edureka
Python Tutorial | Python Tutorial for Beginners | Python Training | EdurekaPython Tutorial | Python Tutorial for Beginners | Python Training | Edureka
Python Tutorial | Python Tutorial for Beginners | Python Training | EdurekaEdureka!
 
Fundamentals of Python Programming
Fundamentals of Python ProgrammingFundamentals of Python Programming
Fundamentals of Python ProgrammingKamal Acharya
 
Basic Python Programming: Part 01 and Part 02
Basic Python Programming: Part 01 and Part 02Basic Python Programming: Part 01 and Part 02
Basic Python Programming: Part 01 and Part 02Fariz Darari
 
Python Programming Tutorial | Edureka
Python Programming Tutorial | EdurekaPython Programming Tutorial | Edureka
Python Programming Tutorial | EdurekaEdureka!
 
Python Basics | Python Tutorial | Edureka
Python Basics | Python Tutorial | EdurekaPython Basics | Python Tutorial | Edureka
Python Basics | Python Tutorial | EdurekaEdureka!
 
What is Python? | Edureka
What is Python? | EdurekaWhat is Python? | Edureka
What is Python? | EdurekaEdureka!
 
Python-01| Fundamentals
Python-01| FundamentalsPython-01| Fundamentals
Python-01| FundamentalsMohd Sajjad
 
Introduction to Object Oriented Programming
Introduction to Object Oriented ProgrammingIntroduction to Object Oriented Programming
Introduction to Object Oriented ProgrammingMoutaz Haddara
 
Python Foundation – A programmer's introduction to Python concepts & style
Python Foundation – A programmer's introduction to Python concepts & stylePython Foundation – A programmer's introduction to Python concepts & style
Python Foundation – A programmer's introduction to Python concepts & styleKevlin Henney
 

What's hot (20)

Introduction to python programming
Introduction to python programmingIntroduction to python programming
Introduction to python programming
 
Python Course | Python Programming | Python Tutorial | Python Training | Edureka
Python Course | Python Programming | Python Tutorial | Python Training | EdurekaPython Course | Python Programming | Python Tutorial | Python Training | Edureka
Python Course | Python Programming | Python Tutorial | Python Training | Edureka
 
1.python interpreter and interactive mode
1.python interpreter and interactive mode1.python interpreter and interactive mode
1.python interpreter and interactive mode
 
Python Tutorial Part 2
Python Tutorial Part 2Python Tutorial Part 2
Python Tutorial Part 2
 
Intro to Python for Non-Programmers
Intro to Python for Non-ProgrammersIntro to Python for Non-Programmers
Intro to Python for Non-Programmers
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Python Tutorial | Python Tutorial for Beginners | Python Training | Edureka
Python Tutorial | Python Tutorial for Beginners | Python Training | EdurekaPython Tutorial | Python Tutorial for Beginners | Python Training | Edureka
Python Tutorial | Python Tutorial for Beginners | Python Training | Edureka
 
Fundamentals of Python Programming
Fundamentals of Python ProgrammingFundamentals of Python Programming
Fundamentals of Python Programming
 
Basic Python Programming: Part 01 and Part 02
Basic Python Programming: Part 01 and Part 02Basic Python Programming: Part 01 and Part 02
Basic Python Programming: Part 01 and Part 02
 
Python introduction
Python introductionPython introduction
Python introduction
 
Python final ppt
Python final pptPython final ppt
Python final ppt
 
Intro to Python
Intro to PythonIntro to Python
Intro to Python
 
Python training
Python trainingPython training
Python training
 
Python Programming Tutorial | Edureka
Python Programming Tutorial | EdurekaPython Programming Tutorial | Edureka
Python Programming Tutorial | Edureka
 
Python Basics | Python Tutorial | Edureka
Python Basics | Python Tutorial | EdurekaPython Basics | Python Tutorial | Edureka
Python Basics | Python Tutorial | Edureka
 
Introduction to the Python
Introduction to the PythonIntroduction to the Python
Introduction to the Python
 
What is Python? | Edureka
What is Python? | EdurekaWhat is Python? | Edureka
What is Python? | Edureka
 
Python-01| Fundamentals
Python-01| FundamentalsPython-01| Fundamentals
Python-01| Fundamentals
 
Introduction to Object Oriented Programming
Introduction to Object Oriented ProgrammingIntroduction to Object Oriented Programming
Introduction to Object Oriented Programming
 
Python Foundation – A programmer's introduction to Python concepts & style
Python Foundation – A programmer's introduction to Python concepts & stylePython Foundation – A programmer's introduction to Python concepts & style
Python Foundation – A programmer's introduction to Python concepts & style
 

Similar to Introduction to Basics of Python

TOPIC-2-Expression Variable Assignment Statement.pdf
TOPIC-2-Expression Variable Assignment Statement.pdfTOPIC-2-Expression Variable Assignment Statement.pdf
TOPIC-2-Expression Variable Assignment Statement.pdfEjazAlam23
 
Python (Data Analysis) cleaning and visualize
Python (Data Analysis) cleaning and visualizePython (Data Analysis) cleaning and visualize
Python (Data Analysis) cleaning and visualizeIruolagbePius
 
Basic data types in python
Basic data types in pythonBasic data types in python
Basic data types in pythonsunilchute1
 
An Introduction : Python
An Introduction : PythonAn Introduction : Python
An Introduction : PythonRaghu Kumar
 
Introduction To Programming with Python-1
Introduction To Programming with Python-1Introduction To Programming with Python-1
Introduction To Programming with Python-1Syed Farjad Zia Zaidi
 
Literals, primitive datatypes, variables, expressions, identifiers
Literals, primitive datatypes, variables, expressions, identifiersLiterals, primitive datatypes, variables, expressions, identifiers
Literals, primitive datatypes, variables, expressions, identifiersTanishq Soni
 
CS 360 LAB 3 STRINGS, FUNCTIONS, AND METHODSObjective The purpos.docx
CS 360 LAB 3 STRINGS, FUNCTIONS, AND METHODSObjective The purpos.docxCS 360 LAB 3 STRINGS, FUNCTIONS, AND METHODSObjective The purpos.docx
CS 360 LAB 3 STRINGS, FUNCTIONS, AND METHODSObjective The purpos.docxfaithxdunce63732
 
FUNDAMENTALS OF PYTHON LANGUAGE
 FUNDAMENTALS OF PYTHON LANGUAGE  FUNDAMENTALS OF PYTHON LANGUAGE
FUNDAMENTALS OF PYTHON LANGUAGE Saraswathi Murugan
 
Python (3).pdf
Python (3).pdfPython (3).pdf
Python (3).pdfsamiwaris2
 
Improve Your Edge on Machine Learning - Day 1.pptx
Improve Your Edge on Machine Learning - Day 1.pptxImprove Your Edge on Machine Learning - Day 1.pptx
Improve Your Edge on Machine Learning - Day 1.pptxCatherineVania1
 

Similar to Introduction to Basics of Python (20)

TOPIC-2-Expression Variable Assignment Statement.pdf
TOPIC-2-Expression Variable Assignment Statement.pdfTOPIC-2-Expression Variable Assignment Statement.pdf
TOPIC-2-Expression Variable Assignment Statement.pdf
 
Python cheat-sheet
Python cheat-sheetPython cheat-sheet
Python cheat-sheet
 
Python (Data Analysis) cleaning and visualize
Python (Data Analysis) cleaning and visualizePython (Data Analysis) cleaning and visualize
Python (Data Analysis) cleaning and visualize
 
Python revision tour i
Python revision tour iPython revision tour i
Python revision tour i
 
Python 3.pptx
Python 3.pptxPython 3.pptx
Python 3.pptx
 
Python basics
Python basicsPython basics
Python basics
 
Basic data types in python
Basic data types in pythonBasic data types in python
Basic data types in python
 
python
pythonpython
python
 
An Introduction : Python
An Introduction : PythonAn Introduction : Python
An Introduction : Python
 
Introduction To Programming with Python-1
Introduction To Programming with Python-1Introduction To Programming with Python-1
Introduction To Programming with Python-1
 
Literals, primitive datatypes, variables, expressions, identifiers
Literals, primitive datatypes, variables, expressions, identifiersLiterals, primitive datatypes, variables, expressions, identifiers
Literals, primitive datatypes, variables, expressions, identifiers
 
CS 360 LAB 3 STRINGS, FUNCTIONS, AND METHODSObjective The purpos.docx
CS 360 LAB 3 STRINGS, FUNCTIONS, AND METHODSObjective The purpos.docxCS 360 LAB 3 STRINGS, FUNCTIONS, AND METHODSObjective The purpos.docx
CS 360 LAB 3 STRINGS, FUNCTIONS, AND METHODSObjective The purpos.docx
 
Pythonppt28 11-18
Pythonppt28 11-18Pythonppt28 11-18
Pythonppt28 11-18
 
FUNDAMENTALS OF PYTHON LANGUAGE
 FUNDAMENTALS OF PYTHON LANGUAGE  FUNDAMENTALS OF PYTHON LANGUAGE
FUNDAMENTALS OF PYTHON LANGUAGE
 
Python.pptx
Python.pptxPython.pptx
Python.pptx
 
Python
PythonPython
Python
 
Programming with Python
Programming with PythonProgramming with Python
Programming with Python
 
Python (3).pdf
Python (3).pdfPython (3).pdf
Python (3).pdf
 
Improve Your Edge on Machine Learning - Day 1.pptx
Improve Your Edge on Machine Learning - Day 1.pptxImprove Your Edge on Machine Learning - Day 1.pptx
Improve Your Edge on Machine Learning - Day 1.pptx
 
Python slide.1
Python slide.1Python slide.1
Python slide.1
 

More from Elewayte

Cyber Security Threats Unveilded
Cyber Security Threats UnveildedCyber Security Threats Unveilded
Cyber Security Threats UnveildedElewayte
 
Cracking Interview: The Ultimate Cheat Sheet on Soft Skills
Cracking Interview: The Ultimate Cheat Sheet on Soft SkillsCracking Interview: The Ultimate Cheat Sheet on Soft Skills
Cracking Interview: The Ultimate Cheat Sheet on Soft SkillsElewayte
 
Demystifying Data Science using Python
Demystifying Data Science using PythonDemystifying Data Science using Python
Demystifying Data Science using PythonElewayte
 
Node.js & Express.js Unleashed
Node.js & Express.js UnleashedNode.js & Express.js Unleashed
Node.js & Express.js UnleashedElewayte
 
From Flexbox to Hooks
From Flexbox to HooksFrom Flexbox to Hooks
From Flexbox to HooksElewayte
 
API & Backend Integration
API & Backend IntegrationAPI & Backend Integration
API & Backend IntegrationElewayte
 
Elewayte Cloud Computing Advancements
Elewayte Cloud Computing AdvancementsElewayte Cloud Computing Advancements
Elewayte Cloud Computing AdvancementsElewayte
 
Introduction to 32-Bit Embedded System
Introduction to 32-Bit Embedded SystemIntroduction to 32-Bit Embedded System
Introduction to 32-Bit Embedded SystemElewayte
 
Web Content Management System
Web Content Management SystemWeb Content Management System
Web Content Management SystemElewayte
 
Design Thinking & Back-End Architecture
Design Thinking & Back-End ArchitectureDesign Thinking & Back-End Architecture
Design Thinking & Back-End ArchitectureElewayte
 
Leveraging the Power of Web Development in Digital Marketing
Leveraging the Power of Web Development in Digital MarketingLeveraging the Power of Web Development in Digital Marketing
Leveraging the Power of Web Development in Digital MarketingElewayte
 
The Ultimate Power Bi Tutorial | Elewayte
The Ultimate Power Bi Tutorial | ElewayteThe Ultimate Power Bi Tutorial | Elewayte
The Ultimate Power Bi Tutorial | ElewayteElewayte
 

More from Elewayte (12)

Cyber Security Threats Unveilded
Cyber Security Threats UnveildedCyber Security Threats Unveilded
Cyber Security Threats Unveilded
 
Cracking Interview: The Ultimate Cheat Sheet on Soft Skills
Cracking Interview: The Ultimate Cheat Sheet on Soft SkillsCracking Interview: The Ultimate Cheat Sheet on Soft Skills
Cracking Interview: The Ultimate Cheat Sheet on Soft Skills
 
Demystifying Data Science using Python
Demystifying Data Science using PythonDemystifying Data Science using Python
Demystifying Data Science using Python
 
Node.js & Express.js Unleashed
Node.js & Express.js UnleashedNode.js & Express.js Unleashed
Node.js & Express.js Unleashed
 
From Flexbox to Hooks
From Flexbox to HooksFrom Flexbox to Hooks
From Flexbox to Hooks
 
API & Backend Integration
API & Backend IntegrationAPI & Backend Integration
API & Backend Integration
 
Elewayte Cloud Computing Advancements
Elewayte Cloud Computing AdvancementsElewayte Cloud Computing Advancements
Elewayte Cloud Computing Advancements
 
Introduction to 32-Bit Embedded System
Introduction to 32-Bit Embedded SystemIntroduction to 32-Bit Embedded System
Introduction to 32-Bit Embedded System
 
Web Content Management System
Web Content Management SystemWeb Content Management System
Web Content Management System
 
Design Thinking & Back-End Architecture
Design Thinking & Back-End ArchitectureDesign Thinking & Back-End Architecture
Design Thinking & Back-End Architecture
 
Leveraging the Power of Web Development in Digital Marketing
Leveraging the Power of Web Development in Digital MarketingLeveraging the Power of Web Development in Digital Marketing
Leveraging the Power of Web Development in Digital Marketing
 
The Ultimate Power Bi Tutorial | Elewayte
The Ultimate Power Bi Tutorial | ElewayteThe Ultimate Power Bi Tutorial | Elewayte
The Ultimate Power Bi Tutorial | Elewayte
 

Recently uploaded

Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 

Recently uploaded (20)

Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 

Introduction to Basics of Python

  • 1. www.elewayte.com GET READY TO SSSSSSINK INTO PYTHON BASICS, ITS POWER & VERSATILITY
  • 2. iNTRODUCTION TO PYTHON Python is a high-level programming language that is widely used in various fields, including data science, web development, and artificial intelligence. Some of the key elements of Python include: 01 DATA TYPES 02 VARIABLES 03 OPERATORS 04 CONDITIONAL STATEMENTS 05 LOOPS 06 FUNCTIONS 07 LIBRARIES
  • 3. Data Types: So Many Flavors, So Little Time! In Python, data types are categories of values that determine how the values behave and what operations can be performed on them. Here are some common data types and their examples: TYPES DESCRIPTION EXAMPLES Numeric Represents numerical values 'int' , 'float' , 'complex' Sequence Represents a collection of ordered and indexed values 'list' , 'tuple' , 'range' Text Represents a sequence of characters 'str' Mapping Represents a collection of key-value pairs 'dict' Set Represents a collection of unique elements 'set' , 'frozenset' Boolean Represents a binary truth value 'bool' Binary Represents binary data 'bytes' , 'bytearray' , 'memoryview'
  • 4. Examples that shows how different data types can be used in Python:
  • 5. Variables: Party Time! Get Your Data On! A variable in Python is just a name that represents a value, and you can use it to store and manipulate data throughout your program. Let’s understand the same with a small example: In Python, we’ll try to create a variable called "age" and assign a value to it, like this: Now, whenever you need to use that age value in your program, you can just use the variable name "age". For example: The output will be: In this example, the variable "age" is assigned the value 15. Then, the print statement uses the value of the variable "age" to output the string "I am 15 years old." Note: We use the str() function to convert the integer value of "age" into a string, so we can concatenate it with the other strings in the output statement.
  • 6. Operators: Go crazy with Calculations! In Python, operators are symbols or special characters that allow you to perform different kinds of operations on variables and values. Here's a table that summarizes the different types of operators in Python, along with their descriptions and examples: TYPES DESCRIPTION EXAMPLES Arithmetic Operators Used to perform arithmetic operations '2 + 3' returns '5' Comparison Operators Used to compare values '2 < 3' returns 'True' Logical Operators Used to combine and manipulate boolean values 'True and False' returns 'False' Bitwise Operators Used to perform bitwise operations '5 & 3' returns '1' Assignment Operators Used to assign values to variables 'x=5' Identity Operators Used to compare the memory location of two objects 'x is y' returns 'True' Membership Operators Used to check if a value is present in a sequence '2 in [1, 2, 3]' return 'True'
  • 7.
  • 8. Conditional Statements: Be the boss of your code! Conditional statements in allow you to control the flow of your program based on certain conditions. They are used to make decisions in your code, and they help your program to be more flexible and responsive to different inputs. Here's a detailed description along with examples that demonstrates the different types of conditional statements in Python to perform various kinds of checks, such as checking if a number is greater than a certain value, or if it falls within a certain range. When you run this code, you will see the output for each conditional statement. TYPES DESCRIPTION EXAMPLES If statement Executes a block of code if a condition is true 'x=5' <br> 'if x>3:'<br> 'print("x is greater than 3")' If else statement Executes one block of code if a condition is true and another block if it is false 'x=2' <br> 'if x>3: '<br> 'print("x is greater than 3")' <br> 'else:' <br> 'print("x is less than or equal to 3")' elif statement Executes a block of code if a condition is true, and if not, checks another condition 'x = 5' <br> 'if x > 7: ' <br> 'print("x is greater than 7")' <br> 'elif x > 3: '<br> 'print("x is greater than 3 but less than or equal to 7")' <br> 'else:' <br> 'print("x is less than or equal to 3")' nested if statement Executes a block of code if a condition is true, and that block can contain another if statement 'x = 5' <br> 'if x > 3:' <br> 'if x < 7:' <br> 'print("x is between 3 and7")' <br> 'else:' <br> 'print("x is greater than or equal to 7")' <br> 'else:'<br> 'print("x is less than or equal to 3")'
  • 9. Loops: Repeat After Me! Loops are used to repeat a block of code multiple times until a certain condition is met. There are two main types of loops in Python: for loops and while loops. Here's an example of a for loop that iterates over a list of numbers and prints each number along with the output. In this example, the loop will continue to run as long as count is greater than 0. Each time the loop runs, it prints the value of count, then subtracts 1 from it. Eventually, count becomes 0, and the loop stops running. There are also other types of loops in Python, such as nested loops, which allow you to put one loop inside another, and break and continue statements, which allow you to control the flow of the loop. INPUT OUTPUT FOR LOOP LOOP TYPE DESCRIPTION 'for' loop Used to iterate over a sequence of elements, such as a list or string 'while' loop Used to repeat a block of code while a certain condition is true WHILE LOOP
  • 10. FUNCTION TYPE DESCRIPTION Built-in functions Functions that are built in python and can be used without needing to define them. Examples - 'print()' , 'len()' and 'range()' User-defined functions Functions that you create yourself to perform a specific task. They can be reused multiple times throughout your code. Functions: The Superheroes of Code! Functions are reusable blocks of code that perform a specific task. They allow you to write a piece of code once and use it multiple times without having to rewrite the code. There are two main types of functions in Python: built-in functions and user- defined functions. In this example, we define a function called add_numbers() that takes two parameters, a and b. The function adds a and b together and returns the sum. We then call the function with the values 2 and 3, which returns 5. Finally, we print the result. INPUT OUTPUT Built-in function User- defined function
  • 11. Functions Continue... Here's an example of using the math library to calculate the square root of a number: Another example is using the pandas library to read a CSV file and display its contents:
  • 12. Python's Top Guns: The Most Important Libraries 1. NumPy NumPy is a library for numerical computing in Python. It provides fast and efficient array operations and linear algebra routines. 2. Pandas Pandas is a library for data manipulation and analysis in Python. It provides powerful tools for working with structured data, such as dataframes and series. Example for importing NumPy Library in Python Example for importing Pandas Library in Python
  • 13. Libraries Continue... Matplotlib is a library for data visualization in Python. It provides a variety of plots and charts for visualizing data, including line plots, scatter plots, and histograms. Scikit-learn is a library for machine learning in Python. It provides tools for data preprocessing, model selection, and evaluation, as well as a range of machine learning algorithms. Example for importing Matplotlib Library in Python Example for importing Scikit- learn library in Python 3. Matplotlib 4. Scikit-learn
  • 14. FOLLOW FOR MORE SUCH CONTENTS www.elewayte.com elewayte_edu Elewayte Elewayte elewayte_