Answers for "if else using ternary operator in python"

2

ternary operator python

return a if a > b else b
Posted by: Guest on August-03-2021
0

Example of Ternary Operator in Python

Program to demonstrate ternary operators in Python
marks = input('Enter the marks: ')
print("The result is Pass" if int(marks)>=35 else "The result is Fail")
Posted by: Guest on November-29-2021

Python Answers by Framework

Browse Popular Code Answers by Language