Skip to content

Instantly share code, notes, and snippets.

@stinethebean3
Last active July 21, 2017 04:43
Show Gist options
  • Select an option

  • Save stinethebean3/1bd4387d8c86d1b91cadbf825e12fe01 to your computer and use it in GitHub Desktop.

Select an option

Save stinethebean3/1bd4387d8c86d1b91cadbf825e12fe01 to your computer and use it in GitHub Desktop.
Fizzbuzz
#!/bin/node
//Array.from(Array(101).keys()).forEach(function(i) {
for (var i = 0; i < 101; i++) {
if ((i % 3) == 0) {
console.log("fizz");
}
if ((i % 5) == 0) {
console.log("buzz");
}
if ((i % 3) == 0 && (i % 5) == 0) {
console.log("fizzbuzz");
}
}
// })
#!/bin/python
for num in range(1,101):
if num % 3 == 0:
print("fizz")
if num % 5 == 0:
print("buzz")
if num % 3 == 0 and num % 5 == 0:
print("fizzbuzz")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment