There are many programming languages available in the market, here one of the most programming language is Python which is widely used high-level programming language. With the multiple functions, it has become very popular. It has the capability to iterate over those things of any series.
Syntax :
Many of you have used range() in Python but here It is need to what exactly is. It creates a list of numbers, which is used for loops. This function works up to the particular range and runs fine.
Here we are going to understand iterating using the range(). See the following simple example which is given below..
As we have seen that Python is the widely used programming language in this each key value separated by a colon : , and all items are separated by commas, whole body will enclosed in curly braces. If there is an empty dictionary no any items so just two curly braces will be like {}.
Dictionary values can be of any type.
How to Access the Values in Dictionary:
Every execution produces some result so here we see how to access dictionary elements.
If you are executing code which contain the loop and when execution never get the condition false so it is called Infinite Loop. In this condition there is no end for results and continue run. It is good when client/server programming where the server required.
Syntax :
Loop is a way by which expression can be executed up to given n number of the condition. If there is a sequence that contains an expression list so it will be evaluated first.
If you have exact code and you are going to execute so you will get the following result
Iterating Python for loop using range() function :
Many of you have used range() in Python but here It is need to what exactly is. It creates a list of numbers, which is used for loops. This function works up to the particular range and runs fine.
Here we are going to understand iterating using the range(). See the following simple example which is given below..
Here you can see below result when above code will be executed, see the following result
Dictionary data type example using for loop :
As we have seen that Python is the widely used programming language in this each key value separated by a colon : , and all items are separated by commas, whole body will enclosed in curly braces. If there is an empty dictionary no any items so just two curly braces will be like {}.
Dictionary values can be of any type.
How to Access the Values in Dictionary:
Every execution produces some result so here we see how to access dictionary elements.
After execution the above code, you will get following result
Python Infinite Loop :
If you are executing code which contain the loop and when execution never get the condition false so it is called Infinite Loop. In this condition there is no end for results and continue run. It is good when client/server programming where the server required.
Now when you execute above-given code you will get the following result