Advertisement
fkudinov

2. Fizz Buzz / Вирішуємо задачі на Python CheckIO Українською

Dec 6th, 2023
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.60 KB | Source Code | 0 0
  1. def checkio(number: int) -> str:
  2.     return ""
  3.  
  4.  
  5. # Some hints:
  6. # Convert a number in the string with str(n)
  7.  
  8. # These "asserts" using only for self-checking and not necessary for auto-testing
  9. if __name__ == '__main__':
  10.     print('Example:')
  11.     print(checkio(15))
  12.    
  13.     assert checkio(15) == "Fizz Buzz", "15 is divisible by 3 and 5"
  14.     assert checkio(6) == "Fizz", "6 is divisible by 3"
  15.     assert checkio(5) == "Buzz", "5 is divisible by 5"
  16.     assert checkio(7) == "7", "7 is not divisible by 3 or 5"
  17.    
  18.     print("Coding complete? Click 'Check' to review your tests and earn cool rewards!")
Tags: checkio
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement