Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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")
Source by itsmycode.com #
 
PREVIOUS NEXT
Tagged: #Example #Ternary #Operator #Python
ADD COMMENT
Topic
Name
3+5 =