Computer Science, asked by gautamcholkar7234, 8 months ago

What are the two types of else clause in Python ? Ans. The two types of Python else clauses are :

Answers

Answered by sumeena
4

Answer:

(a) else in an, if statement

(b)else in a loop statement

Answered by mariospartan
2

For loop with else and regular else with if

Explanation:

if loop with else:

This is available in almost" all the programming language"

This type of if is used to check condition and when the condition is satisfied the statements under if will be executed.

When the condition is false, the statement under else will be executed.

for loop with else:

This is an unique feature of python.

There might some situation where when the looping has to be continued for "specified number of times" to execute certain statements and when the condition fails, other set of operation to be performed.

Example: When the user wants to find whether even numbers are present in the list, he can execute a for loop and when nothing is present we cannot print the relevant message in else.

To Know More:

1. Explain for loop in python......​

https://brainly.in/question/14673533

2. https://brainly.in/question/11962694

Program to find factorial using for loop in python

Similar questions