Types of Statements in Python Programming LanguageExplore Skilled
The slide describes the types of flow control statements in Python including conditional statement , loop statement , control statement such as break and continue .
Types of Statements in Python Programming LanguageExplore Skilled
The slide describes the types of flow control statements in Python including conditional statement , loop statement , control statement such as break and continue .
Python Session - 4
if
nested-if
if-else
elif (else if)
for loop (for iterating_var in sequence: )
while loop
break
continnue
pass
What is a function in Python?
Types of Functions
How to Define & Call Function
Scope and Lifetime of variables
lambda functions(anonymous functions)
First in the series of slides for python programming, covering topics like programming language, python programming constructs, loops and control statements.
This presentation provides the information on python including the topics Python features, applications, variables and operators in python, control statements, numbers, strings, print formatting, list and list comprehension, dictionaries, tuples, files, sets, boolean, mehtods and functions, lambda expressions and a sample project using Python.
Python Session - 4
if
nested-if
if-else
elif (else if)
for loop (for iterating_var in sequence: )
while loop
break
continnue
pass
What is a function in Python?
Types of Functions
How to Define & Call Function
Scope and Lifetime of variables
lambda functions(anonymous functions)
First in the series of slides for python programming, covering topics like programming language, python programming constructs, loops and control statements.
This presentation provides the information on python including the topics Python features, applications, variables and operators in python, control statements, numbers, strings, print formatting, list and list comprehension, dictionaries, tuples, files, sets, boolean, mehtods and functions, lambda expressions and a sample project using Python.
Ethnobotany and Ethnopharmacology:
Ethnobotany in herbal drug evaluation,
Impact of Ethnobotany in traditional medicine,
New development in herbals,
Bio-prospecting tools for drug discovery,
Role of Ethnopharmacology in drug evaluation,
Reverse Pharmacology.
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
How to Split Bills in the Odoo 17 POS ModuleCeline George
Bills have a main role in point of sale procedure. It will help to track sales, handling payments and giving receipts to customers. Bill splitting also has an important role in POS. For example, If some friends come together for dinner and if they want to divide the bill then it is possible by POS bill splitting. This slide will show how to split bills in odoo 17 POS.
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxEduSkills OECD
Andreas Schleicher presents at the OECD webinar ‘Digital devices in schools: detrimental distraction or secret to success?’ on 27 May 2024. The presentation was based on findings from PISA 2022 results and the webinar helped launch the PISA in Focus ‘Managing screen time: How to protect and equip students against distraction’ https://www.oecd-ilibrary.org/education/managing-screen-time_7c225af4-en and the OECD Education Policy Perspective ‘Students, digital devices and success’ can be found here - https://oe.cd/il/5yV
Unit 8 - Information and Communication Technology (Paper I).pdfThiyagu K
This slides describes the basic concepts of ICT, basics of Email, Emerging Technology and Digital Initiatives in Education. This presentations aligns with the UGC Paper I syllabus.
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
How to Create Map Views in the Odoo 17 ERPCeline George
The map views are useful for providing a geographical representation of data. They allow users to visualize and analyze the data in a more intuitive manner.
2. Conditional Statements
There comes situations in real life when we need to
do some specific task and based on some specific
conditions and, we decide what should we do next.
Similarly there comes a situation in programming
where a specific task is to be performed if a specific
condition is True. In such cases, conditional
statements can be used.
The following are the conditional statements
provided by Python.
if
If else
Nested if
3. If Statement
If the simple code of block is to be performed
if the condition holds true then the if statement is
used. Here the condition mentioned holds true
then the code of the block runs otherwise not.
Syntax:
if condition:
# Statements to execute if
# condition is true
4. If else Statement
In conditional if Statement the additional
block of code is merged as else statement which
is performed when if condition is false.
Syntax:
if (condition):
# Executes this block if
# condition is true
else:
# Executes this block if
# condition is false
5. Nested if Statement
if statement can also be checked inside other if
statement. This conditional statement is called a
nested if statement. This means that inner if
condition will be checked only if outer if condition is
true and by this, we can see multiple conditions to
be satisfied.
Syntax:
if (condition1):
# Executes when condition1 is true
if (condition2):
# Executes when condition2 is true
# if Block is end here
# if Block is end here
6. Loops
Python programming language provides the
following types of loops to handle looping
requirements. Python provides three ways for
executing the loops. While all the ways provide
similar basic functionality, they differ in their syntax
and condition-checking time.
7. While Loop in Python
In python, a while loop is used to execute a
block of statements repeatedly until a given
condition is satisfied. And when the condition
becomes false, the line immediately after the
loop in the program is executed.
Syntax:
while expression: statement(s)
8. For Loop
For loops are used for sequential traversal. For
example: traversing a list or string or array etc. In
Python, there is “for in” loop which is similar to for
each loop in other languages. Let us learn how to
use for in loop for sequential traversals.
Syntax:
for iterator_var in sequence: statements(s)
9. Loop Control Statements
Loop control statements change execution from
their normal sequence. When execution leaves a
scope, all automatic objects that were created in
that scope are destroyed. Python supports the
following control statements.
Continue Statement
the continue statement
in Python returns the
control to the beginning
of the loop.
11. Functions
A function is a block of code which only runs
when it is called.
You can pass data, known as parameters, into a
function.
A function can return data as a result.
12. Invoking Built In Functions
Python has various functions which are readily
available. These functions are termed built in functions. On
this reference page, you will be able to see all the built-in
functions available in Python:
Python abs()
It returns the absolute and exact value of a given number
Python all()
It returns true when all the elements in iterable are true
Python chr()
It returns a Character from an Integer
Python classmethod()
It returns the class method for the provided function
13. random() Function in
Python
random(), simply speaking, is an inbuilt function of
the random module in Python3 and it helps in the
derivation of the python random list. Furthermore,
the random module in Python provides access to
some useful functions and one of them is able to
facilitate the generation of random floating
numbers, which is random(). Also, its syntax is
random. random() python.
Syntax: random.random()
Parameters: Any parameter is not accepted by
this method.
Returns: Random floating number between 0
and 1 is returned by this method.
15. randint() Function in
Python
randint() refers to an inbuilt function belonging to
the random module in Python3. Furthermore,
access is provided by random module provides
access to some beneficial functions.
Moreover, one of the functions is to generate
random numbers, which is randint().
Syntax : randint(start, end)
Parameters : (start, end) : Both of them have to
be integer-type values.
Returns : A random integer in the range [start,
end] consisting of the endpoints.
17. Errors and Exceptions :
ValueError: Returns a ValueError when floating-
point values are passed as parameters.
TypeError: TypeError is returned when anything
other than numeric values is passed as
parameters.