iOS Swift Basics An Introduction to Swift Programming Working With Variables

Jabor Al thani
Jabor Al thani
2,926 Points

Code works in Xcode's playground but not Treehouse's .

Im not sure why my code won't work here when it displays perfectly in Xcode's playground ,

// Enter your code below

var language = "Swift"

language = language + " " + "Objective-C"

1 Answer

Jennifer Nordell
Jennifer Nordell
Treehouse Teacher

Hi there! You're doing great, but you're not fulfilling the requirements of the challenge. The challenge asks you to replace the original value of "Swift" with "Objective-C", but instead, you've appended " Objective-C" on to the end of "Swift". The final value of language in your code is "Swift Objective-C".

The final value of language should be simply "Objective-C".

Note: It is possibly to have fully functional code outside the challenge that doesn't meet challenge requirements. Challenges are very strict and looking for one specific answer.

Hope this helps, but let me know if you're still stuck! :sparkles: