Loops in Python

I'm an aspiring Software Engineer specializing in web development. I have built various web apps and utilities using Javascript, ReactJS and NodeJS technologies.
I'm currently working on a full-stack project named JU Query, an online platform for University students to connect with peers, juniors and seniors, ask and answer doubts, help each other out as a growing community.
I'm a polyglot programmer in diverse languages such as C, C++, Java, Python, JavaScript and TypeScript.
I'm also a blogger where I have published various posts on programming, python language and course works to share my knowledge and spread awareness. I have received more than 10,000+ reads from platforms like Medium, Dev and Hackernoon.
I love to contribute to the world through community work. I'm a community leader where I spread awareness, promote and educate students on how to code. I have personally taught Internet basics and front end web development for over 400+ students. I have additionally participated in several initiatives as an NSS volunteer.
I'm a passionate learner who has gained knowledge from numerous events and workshops. I have learnt about Aeromodelling, Rover sensor project, Smart devices using the internet of things. And I have also won the runners up position in the open day competition conducted by IIAEM for building a cost-efficient Hydraulic Arm.
My hobbies include sketching, graphic design, reading books, and watching selective movies.
Have you ever felt like you are doing certain tasks again and again in life?
Well, I’m no expert in helping with your life!
Although, if you would ever face the same situation in a programming language I can help you with that.
In programming, we can repeat certain tasks using loops.
Let’s go through them one by one.
for loop
forloop in Python repeats over each item of a given sequence (a list or a string), in the order that they appear in the sequence.
Example:

Output:
I want to watch a movie directed by James Cameron
I want to watch a movie directed by Christopher Nolan
I want to watch a movie directed by Steven Spielberg
- But, let’s say you are a programmer who needs to iterate over a sequence of numbers, given the limit you want. Well, then you can make use of the built-in function range() which generates arithmetic progressions:

Output:
0
1
2
3
4
while loop
whileloop in python repeats any given set of code until the given condition returns true.
Example:

Output:
0
1
1
2
3
5
8
Who Am I?
I’m Aswin Barath, a Software Engineering Nerd who loves building Web Applications, now sharing my knowledge through Blogging during the busy time of my freelancing work life. Here’s the link to all of my craziness categorized by platforms under one place: https://linktr.ee/AswinBarath
Join me to learn Python!
Checkout my Python Programming Series where my mission is to share my knowledge on Python: https://aswinbarath.hashnode.dev/series/python-programming
Learn what I know about Python from any of my favourite knowledge sources:
Keep Learning
Now, I guess this is where I say GoodBye👋.
But, hey it’s time for you to start learning with your newfound Knowledge(Power)👨💻👩💻 .
Good Job that you made it this far 👏👏
Thank you so much for reading my Blog🙂.




