ETechSavvies

FizzBuzz algorithm implementation in PYTHON

Apr 16th, 2021 (edited)
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. """
  2.    Written by: ETechSavvies [https://t.me/ETechSavvies] Apr 10,2021
  3.    Description: Implements FizzBuzz algorithm
  4.    Copyright 2021 @ETechSavvies
  5. """
  6.  
  7. # Loop from 1 to 100
  8. for number in range(1, 101):
  9.  
  10.     if number % 3 == 0 and number % 5 == 0:
  11.         print("FizzBuzz", end=" ")
  12.  
  13.     elif number % 3 == 0:
  14.         print("Fizz", end=" ")
  15.  
  16.     elif number % 5 == 0:
  17.         print("Buzz", end=" ")
  18.  
  19.     else:
  20.         print(number, end=" ")
Add Comment
Please, Sign In to add comment