Advertisement
SimeonTs

SUPyF Functions - 02. Sign of Integer Number

Jun 15th, 2019
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.58 KB | None | 0 0
  1. """
  2. Functions and Debugging
  3. Проверка: https://judge.softuni.bg/Contests/Compete/Index/922#1
  4.  
  5. 02. Sign of Integer Number
  6.  
  7. Условие:
  8. Create a function that prints the sign of an integer number n.
  9. Examples
  10. Input   Output
  11. 2       The number 2 is positive.
  12. -5      The number -5 is negative.
  13. 0       The number 0 is zero.
  14. """
  15.  
  16.  
  17. def sign_of_integer(num=int(input())):
  18.     if num > 0:
  19.         print(f"The number {num} is positive.")
  20.     elif num < 0:
  21.         print(f"The number {num} is negative.")
  22.     else:
  23.         print(f"The number {num} is zero.")
  24.  
  25.  
  26. sign_of_integer()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement