MCQs > IT & Programming > Python > What is the correct syntax that will set the variable 'var1' to the value 'correct' if variable 'a' is greater than 1?

Python MCQs

What is the correct syntax that will set the variable "var1" to the value "correct" if variable "a" is greater than 1?

Answer

Correct Answer: var1 = "correct" if a > 1 else None

Explanation:

Note: This Question is unanswered, help us to find answer for this one

Python Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Python Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it