Created
February 26, 2019 12:46
-
-
Save metalrufflez/541507a4b577aec6578907e6bd9ba351 to your computer and use it in GitHub Desktop.
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
#!/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('') |
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
#!/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