If-else Statement
If
Marks>70: else
Get Ice Cream Give Practice Test
Pseudo-Code: if-else
If(condition):
Statements to be executed….
else:
Statements to be executed…..
Looping Statements
Get your salary credited
at the end of each month
While Loop
Enter While loop
Test Expression SYNTAX
while condition:
Exit While loop Execute Statements
True
Body of While
For Loop
For Loop is used to iterate over a sequence (tuple, list, dictionary…..)
For loop syntax
for val in sequence:
body of for loop
Functions
Function (Recipe): A function like a recipe is a set of instructions that perform a specific task or operation.
Just like a recipe, a function has a name and can take inputs (ingredients) and produce an output (result).
Input(Ingredients): The Output (Result): It is the
values given to a function result obtained from the
like bread, tomato etc. function like Sandwich.
Functions can be reused multiple times, just like a recipe can be used to make the
same dish repeatedly. They allow us to write code once and use it in different parts of a
program.
Python Functions
Function is a block of code which performs a specific task
Python Lambda Functions
A small anonymous function , taking any number of arguments, having one expression