Last active
March 7, 2017 03:55
-
-
Save Cr4ck3r/320c7b02993b88dc9cdd0eb8ed89f1a5 to your computer and use it in GitHub Desktop.
fizzbuzz for loop
This file contains hidden or 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
| for n in range(1,101): | |
| if n % 3 == 0 and n % 5 == 0: | |
| print ("fizzbuzz") | |
| elif n % 3 == 0: | |
| print ("fizz") | |
| elif n % 5 == 0: | |
| print ("buzz") | |
| else: | |
| print (n) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Same as while loop version, leaving aside
¦characters which are invalid, the code LGTM.