0% found this document useful (0 votes)
4 views3 pages

Understanding While Loops in Computing

A while loop continues to execute as long as a specified condition remains true, unlike a for loop which has defined limits. The document provides pseudocode and Python examples illustrating the structure and usage of while loops. It emphasizes that a while loop can potentially run indefinitely if the condition never becomes false.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views3 pages

Understanding While Loops in Computing

A while loop continues to execute as long as a specified condition remains true, unlike a for loop which has defined limits. The document provides pseudocode and Python examples illustrating the structure and usage of while loops. It emphasizes that a while loop can potentially run indefinitely if the condition never becomes false.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

While Loop

• While loop is like a for loop only difference is


the for loop has a certain limit For an
instance from 10 to 50
• But in the while loop we say until a specific
condition is true the loop will continue even if
it means forever

WHILE LOOP IN PSEUDOCODES

WHILE condition DO
Statement
END WHILE

EG-
WHILE x==“hi” DO
Print(“HI”)
END WHILE

WHILE LOOP IN python


While condition
Rashmitha.J grade 9/10 edexcel
Computing
Statement

MAS | MAS Only

For an instance
While x==“hi”
Print(“bye”)

Rashmitha.J grade 9/10 edexcel


Computing
MAS | MAS Only

Rashmitha.J grade 9/10 edexcel


Computing

You might also like