Complete the code to unwrap the optional 'name' safely.
if let [1] = name { print("Hello, \([1])!") }
The optional variable 'name' is unwrapped using if let syntax. The unwrapped value is assigned to the same variable name 'name' inside the block.
Complete the code to unwrap both optionals 'firstName' and 'lastName' in a single statement.
if let [1] = firstName, let last = lastName { print("Full name: \([1]) \(last)") }
Both optionals are unwrapped in one if let statement. The first optional 'firstName' is unwrapped and assigned to 'firstName' variable.
Fix the error in the multiple optional binding statement.
if let age = age, let [1] = city { print("Age: \(age), City: \([1])") }
The optional 'city' must be unwrapped with the same variable name 'city' to match the print statement.
Fill both blanks to unwrap 'username' and 'password' optionals and print them.
if let [1] = username, let [2] = password { print("User: \([1]), Pass: \([2])") }
Both optionals are unwrapped with the same variable names to match the print statement.
Fill all three blanks to unwrap 'email', 'phone', and 'address' optionals and print them.
if let [1] = email, let [2] = phone, let [3] = address { print("Email: \([1]), Phone: \([2]), Address: \([3])") }
Each optional is unwrapped with the same variable name to match the print statement.