Created
May 21, 2019 18:59
-
-
Save shakyra/a4323423daf0b9ba6dae38b5a90b2536 to your computer and use it in GitHub Desktop.
My nooby attempt at fizzBuzz using for where loops
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var i: Int = 3 | |
var fizz: String = "Fizz" | |
var buzz: String = "Buzz" | |
var fizzBuzz: String = "FizzBuzz" | |
for i in 1...100 where i % 3 == 0 { | |
print(fizz) | |
} | |
for i in 1...100 where i % 5 == 0 { | |
print(buzz) | |
} | |
for i in 1...100 where i % 3 == 0 && i % 5 == 0 { | |
print(fizzBuzz) | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
for i in 1...15 {
}