Skip to content
Snippets Groups Projects
Select Git revision
  • master
1 result

fizzbuzz.py

Blame
  • Forked from GitLab Basics / FizzBuzz
    Source project has a limited visibility.
    fizzbuzz.py 488 B
    def fizzbuzz(i:int) -> str:
        """
        Write a program that prints the numbers from 1 to 100.
        But for multiples of three print "Fizz" instead of the number 
        And for the multiples of five print "Buzz". 
        For numbers which are multiples of both three and five print "FizzBuzz".
        """
    
    
        if i % 3 == 0 and i % 5 == 0:
            s ="FizzBuzz"
    
        elif i % 3 == 0:
            s = "Fizz"
    
        elif i % 5 == 0:
            s ="Buzz"
        else:
            s = str(i)
            
    
        return s