Question:

What output will be produced by the code below?

let (captain, engineer, doctor) = ("Mal", "Kailee", "Simon")
print(engineer)

Correct answer: "Kailee".

Explanation: This code demonstrates tuple destructuring, which is a method of pulling a tuple into multiple individual values in one line of code. In this example, it will create three constants (captainengineer, and doctor), giving them the values "Mal", "Kailee", and "Simon" respectively.

 


Keywords:

© 2017 QuizBucket.org