Advertisement
gustizeppelin

Fizz Buzz

Nov 22nd, 2022 (edited)
748
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. num_1 = int(input("Ingrese el primer numero: "))
  2. num_2 = int(input("Ingrese el segundo numero: "))
  3.  
  4. for a in range(num_1, num_2+1):
  5.     if a % 3 == 0 and a % 5 == 0:
  6.         print("FizzBuzz")
  7.     elif a % 3 == 0:
  8.         print("Fizz")
  9.     elif a % 5 == 0:
  10.         print("Buzz")
  11.     else:
  12.         print(a)
  13.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement