what is an else if statement in python?

0 votes
how do we use else if statement in python? what is the syntax?

is it different from what we use java or c++.
Mar 13 in Python by Mohammad
• 3,060 points
38 views

1 answer to this question.

0 votes
if condition:

   statement

elif condition:

    statement

#this is how you use else if in python. apart from the syntax, everything else is same as in every other programming language.
answered Mar 15 by Waseem
• 4,480 points

Related Questions In Python

+4 votes
7 answers
0 votes
1 answer

how to exit a python script in an if statement

This works fine for me: while True: ...READ MORE

answered Sep 19, 2018 in Python by bug_seeker
• 15,350 points
3,201 views
0 votes
0 answers

What is the logic to check if a number is prime or not in python?

I am looking for a function with ...READ MORE

Aug 2 in Python by Waseem
• 4,480 points
18 views
0 votes
0 answers

What is the syntax for an empty while loop in python?

What kind of ambiguities are expected for ...READ MORE

Aug 5 in Python by Waseem
• 4,480 points
17 views
0 votes
1 answer

How to use nested if else statement in python?

The working of nested if-else is similar ...READ MORE

answered Nov 19, 2018 in Python by Nabarupa
51 views
0 votes
1 answer

How to write inline if statement for print in Python?

Inline if-else expression must always contain the else ...READ MORE

answered Dec 4, 2018 in Python by Nymeria
• 3,520 points

edited Dec 6, 2018 by Nymeria 1,025 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 275 views
0 votes
1 answer

what is a type error in python?

you get a type error when you ...READ MORE

answered Mar 8 in Python by Waseem
• 4,480 points
51 views
0 votes
2 answers

what is null in python?

In python no primitive data types. python treats as ...READ MORE

answered Mar 13 in Python by rajesh kumar
32 views