Forums
Learn
Careers
Store
About
SUBSCRIBE
BLACK FRIDAY SALE: Save 50% on all my Swift books and bundles! >>
Question 1/12: This code will print "Success" – true or false?
Hint: else blocks are executed if the condition is false, and Swift won't let you compare different types of data. Click to show.
else
var city = "Tokyo" if city == "Madrid" { print("Failure") } else { print("Success") }
Correct! This will print "Success" because city is not "Madrid".
city
Oops – that's not correct. This will print "Success" because city is not "Madrid".
Return to Review Menu
You are not logged in
Link copied to your pasteboard.