Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialNot Telling Not Telling
Courses Plus Student 923 PointsI don't understand how to answer this question.
The stuff I wrote doesn't work. I don't understand why.
var todo = ["Learn Swift","Build App","Deploy App"]
var numb = 0
numb = todo.count
println("/(numb)")
2 Answers
Imon Dela Rosa
7,383 PointsHi! What is the error message? something like this:
Expression are not allowed at the top level?
top-level code is not allowed in most of your Swift source files. For clarity, any executable statement not written within a function body, within a class, or otherwise encapsulated is considered top-level.
You have to put inside the Class or function.
Not Telling Not Telling
Courses Plus Student 923 PointsI figured it out shortly after I posted that question. Sorry to bother you, but thanks!