Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

inline_ternary(if)_condition

#inline ternary condition
x = 1 if 2 > 3 else 0
print(x)						# 0
# classic writing will be
if 2 > 3 :
	x = 1
else :
	x = 0
print(x)

# in javascript
# x = 2 > 3 ? 1 : 0					# 0
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
7+6 =