Home / Questions / Other Python में ternary expression कैसे लिखते हैं? — interview में इसका सही जवाब क्या है? Other 0 Views Verified Python में ternary expression कैसे लिखते हैं? — interview में इसका सही जवाब क्या है? #python #python programming #coding #developer Sarkari Result QA Bank Editorially reviewed exam information Share
Verified ternary(age >= 18, 'adult', 'minor') ternary(age >= 18, 'adult', 'minor') Additional Explanation यह विकल्प सही समाधान नहीं है।
Verified Correct Answer result = 'adult' if age >= 18 else 'minor' result = 'adult' if age >= 18 else 'minor' Additional Explanation Python conditional expression का syntax यही है।
Verified result = if age >= 18: 'adult' result = if age >= 18: 'adult' Additional Explanation यह विकल्प सही समाधान नहीं है।
Verified result = age >= 18 ? 'adult' : 'minor' result = age >= 18 ? 'adult' : 'minor' Additional Explanation यह विकल्प सही समाधान नहीं है।