what is loop in python ?
#Agenda
Q.1 what are loops in python ?
- loops allows the execution of a statement or group of statement multiple times
- in order to enter the loop there are certain condition defined in the beginning .
- once the condition becomes false the loop stops and the control more out of the loop .
Q.2 There are three types of loops in python.- while loop
- for loop
- nested loop
- while loop--->>>while loop is known as indefinite or conditional loops .they will keep iterating until certain conditions are met there is no guarantee ahead of time regarding how many times the loop will iterate.
- for loop --->>>for loop is a python loop which repeats a group of statements a specified number of times the for loop provides a syntax where the following information is provided.
- Boolean condition
- the initial value of the counting variable
- incrementation of counting variable
- for <variable> in <range>:
- statement 1
- statement 2
- Nested loop--->>>python programming language allow use of loop inside another loop.this is called nested loop . below is the syntax for the same .
syntax .for iterating _var in sequence for iterating_var in sequence statements statements
syntax.while expression: while expression: statements statements
- while loop
- for loop
- nested loop
- while loop--->>>while loop is known as indefinite or conditional loops .they will keep iterating until certain conditions are met there is no guarantee ahead of time regarding how many times the loop will iterate.
- for loop --->>>for loop is a python loop which repeats a group of statements a specified number of times the for loop provides a syntax where the following information is provided.
- Boolean condition
- the initial value of the counting variable
- incrementation of counting variable
- for <variable> in <range>:
- statement 1
- statement 2
- Nested loop--->>>python programming language allow use of loop inside another loop.this is called nested loop . below is the syntax for the same .
syntax .
good
ReplyDeletenice
ReplyDeletevary good
ReplyDeleteNice
ReplyDeleteSuper
ReplyDeleteVary good
ReplyDeleteबेहतरीन
ReplyDelete