Python Online Compiler
Example: Python program of decision making by using the if-elif-else ladder
C
C++
C#
Java
Python
PHP
main.py
STDIN
Run
# Python program of decision making by using the if-elif-else ladder print("Enter an integer value::") n = int(input()) if (n == 0): print("Fisrt condition is true.\n") elif (n == 1): print("Second condition is true.\n") elif (n == 2): print("Third condition is true.\n") else: print("Condition failed!\n")
1
Output
Clear
ADVERTISEMENTS