Sociology, asked by leezaraj2468, 11 months ago

What do you know about Control statements python ​

Answers

Answered by hempopat31
3

Python supports the following control statements.

Continue Statement. It returns the control to the beginning of the loop.

Break Statement. It brings control out of the loop.

Pass Statement. We use pass statement to write empty loops.

Answered by Anonymous
2

Answer:

Control statements in python are used to control the order of execution of the program based on the values and logic.

Python provides us with 3 types of Control Statements:

Continue

Break

Pass

Explanation:

1) Continue Statement:

Syntax:

continue

Example:

for char in ‘Python’: if (char == ‘y’): continue

print(“Current character: “, char)

Output:

Current character: P

Current character: t

Current character: h

Current character: o

Current character: n

2) Break Statement:

Syntax:

break

Example:

for char in ‘Python’: if (char == ‘h’): break

print(“Current character: “, char)

Output:

Current character: P

Current character: y

Current character: t

3) Pass Statement:

Syntax:

pass

Example:

for char in ‘Python’: if (char == ‘h’): pass

print(“Current character: “, char)

Output:

Current character: P

Current character: y

Current character: t

Current character: h

Current character: o

Current character: n

Similar questions