Skip to main content

Featured post

12 DevOps principles read today

DevOps means a concept to bring Development team and operation team together. So that you can speed up the deployment process. Before you start learning the tools you need to understand core principles.
The useful DevOps Principles to know for your project and interviewsTo deliver rapidly without affecting qualityCommunication and Collaboration are the key ideas in DevOps conceptMultiple deploys are possible- if code in Development team automatedOnce you commit the repository, it tests the code automatically against the automated test scriptsIf Build is successfully passed, it installs automatically in Testing environment When infrastructure is automated, it installs automatically to other serversMinor changes takes place in isolation, that means , it creates separate server to deploy minor changesSpeed in Devops, organizations to better serve their customers and compete more effectively in the market.Quality and Security teams are part of DevOpsAutomating the process, much better pro…

Python For Loop Example: This Is What Professionals Do

The for loop you need is to print the data you want usually multiple times. For loop, is having two arguments such as variable name and in. I have also given video example in the bottom.
for loops in python
In Python for loop list and count are related to same logic. In the below example, I have taken one array or list, and I counted using for loop, the number of elements in this list

For loop Syntax

for count in[1, 2, 3]: 
print(count)
print(’Yes’*count)

First step, How the above syntax works is what I want to share with you. The 'in' represents input array for Python for loop. That means the for loop works 3 times in Python. It displays only 3 times. The third step is just give 'yes', which will multiply with 'count' for 3 times.

This is whole story of for loop in Python. Second step, print just displays values of input that stored in the for loop variable of 'count'.

The 'count' gets values one by one from for loop input array.When you used the Shell to enter a loop, there was a reason that the interpreter waited to respond until after you entered an empty line: The interpreter did not know how long the loop block was going to be! The empty line is a signal to the interpreter that you are done with the loop block.

Index in For loop 

A small example given to get index and value from for loop.
#Get index using for loop
#You will get index and value
mylist=[1, 2, 3]: 
for idx, val in enumerate(mylist):
    print(idx, val)

Video Tutorial

I have created a small video, so that you can play quickly and check how for loop works in Python.
Also read

Comments

Most Viewed

Hyperledger Fabric Real Interview Questions Read Today

I am practicing Hyperledger. This is one of the top listed blockchains. This architecture follows R3 Corda specifications. Sharing the interview questions with you that I have prepared for my interview.

Though Ethereum leads in the real-time applications. The latest Hyperledger version is now ready for production applications. It has now become stable for production applications.
The Hyperledger now backed by IBM. But, it is still an open source. These interview questions help you to read quickly. The below set of interview questions help you like a tutorial on Hyperledger fabric. Hyperledger Fabric Interview Questions1). What are Nodes?
In Hyperledger the communication entities are called Nodes.

2). What are the three different types of Nodes?
- Client Node
- Peer Node
- Order Node
The Client node initiates transactions. The peer node commits the transaction. The order node guarantees the delivery.

3). What is Channel?
A channel in Hyperledger is the subnet of the main blockchain. You c…