PyCodePro

Previously LP16 - A website that teaches Python programming language through interactive tutorials, practice exercises, and real-world projects.

LOOPS AND RANGE

Nested If


We know that the in python ‘ if ’ is a conditional statement and nested if is a if conditional statement inside another if statement

for example –

if a > b :
if a = b

in simple language we can say that the box inside another box .

Loops

There are mainly two basic loops in python they are –

1 – for loop
2 – while loop

Now ,

For Loop – when we know the steps of execution then it is called as for loop

While loop – when we do not know the steps of executions then it is called as while loop .

In simple language ,

For example –

Just suppose your sports teacher said you to run 5 rounds of your school ground in this condition you know that you have to complete the 5 rounds of ground and this condition is known as for loop because you know the steps of execution .

Suppose again your sports teacher said you to run the rounds of your school ground in this condition you do not know that how much rounds you should run and this condition is known as the while loop because in this you do not know the steps of execution . 

The Range Function

The range function is a function to print the sequence or the series of list , tuples , strings .

For example –

In python you have to print the numbers from 0 to 100 then you have two options the first option is the worst and the stupid option is that you will write from 0 to 100 under the print function and the enter the number in double quotes ( “ ” ) and the second option is the easiest and the smartest option that you use the range function of python.

The range function helps you to mainly print the series or the sequence of the numbers , strings , list , tuples .




IN THE NEXT BLOG WE LEARN THAT HOW TO USE RANGE FUNCTION IN PYTHON AND OTHER IMPORTANT SUB TOPICS  
THANK YOU FOR VISITING 
KEEP VISITING
KEEP LEARNING 
STAY TUNED FOR NEXT BLOG
VIEW OUR PREVIOUS BLOG FOR THE BASIC CONCEPTS OF PYTHON AND OTHER BASIC CONCEPTS OF COMPUTER AND ALSO FOR THE IMPORTANT DEFINITIONS OF THE SQL
VISIT OUR SECOND BLOG – indianbasics.blogspot.com
VISIT OUR YOUTUBE CHANNEL -  Learn Python 
Our youtube channel will give you the short motivational speeches of the great person in the present there is only one motivational video on channel but in future I will upload the motivational videos soon .
VISIT OUR INSTAGRAM PAGE – instagram.com/learnpython16
Out instagram page is also a new page i9 have just crated few hours ago but stay tuned I will upload the post very soon . 
Please support us by following our blog and by subscribing our youtube channel and by following our instagram page .

LOOPS AND RANGE LOOPS AND RANGE Reviewed by Learn Python on November 29, 2019 Rating: 5

No comments:

Powered by Blogger.