Skip to content

Instantly share code, notes, and snippets.

@metalrufflez
Created February 26, 2019 12:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save metalrufflez/541507a4b577aec6578907e6bd9ba351 to your computer and use it in GitHub Desktop.
Save metalrufflez/541507a4b577aec6578907e6bd9ba351 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
for i in list(range(1,101)):
if i % 5 and i % 3:
print(i)
else:
if not i % 3:
print("Fizz", end='')
if not i % 5:
print("Buzz", end='')
print('')
#!/bin/bash
for i in {1..100}; do
if [[ $(( $i % 3 )) -ne 0 ]] && [[ $(( $i % 5 )) -ne 0 ]]; then
echo $i
else
if [[ $(( $i % 3 )) -eq 0 ]]; then
echo -n Fizz
fi
if [[ $(( $i % 5 )) -eq 0 ]]; then
echo -n Buzz
fi
echo
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment