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 trial
Buka Cakrawala
5,042 PointsFizzBuzz Generator in Swift Basics
for number in 1...20 {
if (number % 3 == 0) && (number % 5 == 0){
println("FizzBuzz")
} else if (number % 3 ==0) {
println("Fizz")
}
}
This is what i wrote in xcode and I did the same thing as what the video has been told me, but why does the xcode always left a red mark or a wrong mark in the println function always suggesting me to change to print. PLEASE HELP ME. thank you
1 Answer
Steve Hunter
57,712 PointsHi there,
If you change println to print it'll work fine.
Some of the courses are for Swift v1.* but now Xcode is using Swift 2.*. Between the two releases, a couple of things changed; print became the new println, for example. Just use print instead, and you'll be fine.
Steve.