Computer Science, asked by arjun1791, 22 days ago

E. Find the errors in the following programs.
1. X = 5
DO WHILE X <= 50
PRINT X
X = X + 5​

Answers

Answered by bharatpatadia74
1

Answer:

Loops are used to repeatedly execute a block of program statements. The basic loop structure in Python is while loop. Here is the syntax.

Syntax:

while (expression) :

    statement_1

    statement_2

    ....

The while loop runs as long as the expression (condition) evaluates to True and execute the program block. The condition is checked every time at the beginning of the loop and the first time when the expression evaluates to False, the loop stops without executing any remaining statement(s). The following example prints the digits 0 to 4 as we set the condition x < 5.

x = 0; while (x < 5): print(x) x += 1

Attachments:
Similar questions