in Python by
Q:
How Do You Write A Conditional Expression In Python?

▼ Show 1 Answer

0 votes
by

We can utilize the following single statement as a conditional expression. default_statment if Condition else another_statement

>>> no_of_days = 366

>>> is_leap_year = "Yes" if no_of_days == 366 else "No"

>>> print(is_leap_year)

Yes

Python
Learn More with Madanswer

Related questions

0 votes
asked Feb 4, 2020 in Vue.JS by rajeshsharma
...