NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

looping statements are repeats a block of code multiple times. There are three main looping statements available: for loop, while loop, and nested loop.

1.for loop:
The for loop is used to iterate over a sequence (such as a list, tuple, string, or range) or any iterable object. It executes a block of code for each item in the sequence.
Example:
fruits = ["apple", "banana", "cherry"]
for fruit in fruits:
print(fruit)
Output:
apple
banana
cherry
In this example, the for loop iterates over each element in the fruits list and prints each item.

2.while loop:
The while loop executes a block of code as long as a given condition is true. It repeatedly checks the condition before each iteration.
Example:
count = 0
while count < 5:
print("Count:", count)
count += 1

Output:
Count: 0
Count: 1
Count: 2
Count: 3
Count: 4
In this example, the while loop runs until the count variable is less than 5. It prints the value of count and increments it by 1 in each iteration.

3.Nested loop:
A nested loop is a loop inside another loop. It allows you to perform repetitive tasks within repetitive tasks.
Example:
for i in range(1, 4):
for j in range(1, 4):
print(i, j)
Output:

Copy code
1 1
1 2
1 3
2 1
2 2
2 3
3 1
3 2
3 3
In this example, the outer for loop iterates over the values 1 to 3, and the inner for loop iterates over the same values. It prints the combination of both loop variables.
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.