Home / Questions / Other Python में ternary expression कैसे लिखते हैं? — error आने पर developer क्या करे? Other 0 Views Verified Python में ternary expression कैसे लिखते हैं? — error आने पर developer क्या करे? #python #python programming #coding #developer Sarkari Result QA Bank Editorially reviewed exam information Share
Verified result = age >= 18 ? 'adult' : 'minor' result = 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 यही है। पहले traceback की exact line और input value check करें।
Verified result = if age >= 18: 'adult' result = if age >= 18: 'adult' Additional Explanation यह विकल्प सही समाधान नहीं है।
Verified ternary(age >= 18, 'adult', 'minor') ternary(age >= 18, 'adult', 'minor') Additional Explanation यह विकल्प सही समाधान नहीं है।