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 trialPeter O'Brien
9,348 PointsI can't get the code to run. I get an error message stating I can't run Println directly with or without constant use.
These are the functions I've tried:
func greeting() {
let hi = "Hello"
println(hi)
}
greeting()
func greeting() {
println("Hello")
}
greeting()
Its worth noting that both run fine in Xcode. I am using the Safari browser on Mac.
3 Answers
Ricardo Hill-Henry
38,442 PointsIf you're on the first question, they aren't asking you to call greeting() yet, so just delete that for now. This is all you need for the first task:
func greeting() {
println("Hello")
}
notf0und
11,940 PointsAre you trying to call greeting()
in Task 1? You second function is correct, but the Challenge throws that error if you try to call greeting()
outside of Task 2.
Peter O'Brien
9,348 PointsThanks, Bryan. Clearly trying run while the challenge was asking me to walk :-) I don't know how I missed that in the question.
Best, Pete