Easy_Flex

Untitled

Feb 21st, 2020
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.72 KB | None | 0 0
  1. def truthy_or_falsy(value):
  2.     if (type(value)) == int:
  3.         if value < 0:
  4.             return " the value " + str(value) + " is Truthy "
  5.  
  6.         elif value > 0:
  7.             return " The value " + str(value) + " is Truthy "
  8.  
  9.         elif value == 0:
  10.             return " The value " + str(value) + " is Falsy "
  11.  
  12.         else:
  13.             return " The value " + str(value) + " is Falsy "
  14.  
  15.     elif (type(value)) == str:
  16.         if value == "":
  17.             return " The value " + value + " is Falsy "
  18.  
  19.         elif value != "":
  20.             return " The value " + value + " is Truthy "
  21.  
  22.         else:
  23.             return " The value " + value + " is Truthy "
  24.  
  25.     else:
  26.         return
  27.  
  28.  
  29. print(truthy_or_falsy(0))
Add Comment
Please, Sign In to add comment