Categories
|
Test: Swift - Tuples 2. let name: (String, String) - Which of the following assignments work?
Results Congratulations! Correct Answer. You Answered: None. If you took the test, your answer will show up here. Correct Answer: name = (“Thomas”, “Edison”); name = (“1”, “2”); Explanation Here we need a tuple with two non-optional String values. A and B satisfy that requirement. In case a String, C passes nil. This would have worked if the declaration is let name: (String, String?)Take the Test Take the complete test on this topic. You will be able to review answers to questions and get a test score.
Take the Test
Question 2 of 5
Test is Based on this Article
This article discusses the Tuple type which is introduced in Swift, but was not there in C or Objective-C.
|
Test on tuples in Swift.
|
|
More Articles With Similar Tags
|
Test on tuples in Swift.
|
This series of articles goes through the basics of Swift. It introduces Playgrounds and REPL; Variables and Constants; Int, Float, Bool; Tuples, Type Aliases, Type Inference, Type Safety, and more.
|
This article discusses the boolean types in Swift and contrasts with how these types are used in C and Objective-C.
|
Test on Boolean Types in Swift.
|
This article goes through the usage of various integer types in Swift (including Int and UInt).
|
|
|
|
|