PCAP Certified Associate In Python Programming Exam [python]

Access More Questions
Which of the following code snippets correctly uses the ternary operator to assign 'Adult' to the `status` variable if `age` is 18 or greater, and 'Minor' otherwise?
Correct Answer:
status = 'Adult' if age >= 18 else 'Minor'

Access more questions from this quiz

Continue to PCAP Certified Associate in Python Programming Exam [python] for more practice questions and the full quiz experience.

Access More Questions