## If/else syntax debug

While making a game, your partner, Greg, decided to create a function to check if the user is still alive called `checkAlive`/`CheckAlive`/`check_alive`. Unfortunately, Greg made some errors while creating the function.

`checkAlive`/`CheckAlive`/`check_alive` should return true if the player's health is greater than 0 or false if it is 0 or below. 

```if-not:csharp
The function receives one parameter `health` which will always be a whole number between -10 and 10.
```

Difficulty: introductory

Starter code:

def check_alive(health):
	

Solutions:
def check_alive(health):
    if health <= 0:
        return False
    else:
        return True
    
print(check_alive(0))

def check_alive(health):
    if health <= 0:
        return False
    else:
        return True

def check_alive(health: int):
    return health > 0

def check_alive(health):
    if health < 0:
        return False
    elif health == 0:
        return False
    else:
        return True

def check_alive(health: int) -> bool:
    """ Return `true` if the player's health is greater than 0 or `false` if it is 0 or below. """
    return health > 0

def check_alive(health):
    if health in range(-10,0):
        return False
    elif health == 0:
        return False
    else:
        return True

def check_alive(health):
#     If Cond. to check the player's health
    if(health > 0):
#         True / False must be T / F not true / false
        return True
    else:
        return False

def check_alive(check_alive):
    x = check_alive
    if x > 0:
        return True
    else:
        return False

def check_alive(health):
    if health <= 0:
        return False
    else:
        return True
    
check_alive(2)

def check_alive(health):
    if(-10 <= health <= 0):
        return False
    elif 0 < health <= 10:
        return True

def check_alive(health):
    if health <= 0:
        return bool()
    else:
        return bool(True)

def check_alive(health):
    return health > 0

check_alive = (0).__lt__

def check_alive(health):
    return (lambda x: True if x > 0 else False)(health)

check_alive = 0..__lt__

def check_alive(health):
    if health <= 0:
        return False
    else:
        return True
    check_alive(health)

def check_alive(health):
    if health <= 0 or health == 0:
        return False
    else:
        return True

def check_alive(health):
    return False if health < 1 else True
        
#     if():
#         health < 0
#         return false
#     else:
#         return true



health = list(range(-10,10))
def check_alive(health):
    if(health > 0):
        return True
    else:
        return  False



def check_alive(health):
    if 0 >= health:
        return False
    else:
        return True

def check_alive(health):
  -10<health<10
  if health <= 0:
    return False
  else:
    return True

import unittest


def check_alive(health):
    return True if health > 0 else False
    
    
class TestCheckAlive(unittest.TestCase):
    def test_should_return_true_when_health_is_greater_than_0(self):
        self.assertEqual(check_alive(health=1), True)

    def test_should_return_false_when_health_is_0(self):
        self.assertEqual(check_alive(health=0), False)

    def test_should_return_false_when_health_is_negative_int(self):
        self.assertEqual(check_alive(health=-1), False)


check_alive=lambda n:n>0

def check_alive2(func):
    def wrapper(*args, **kwargs):
        
        result = func(*args, **kwargs)
        return result
    return wrapper

@check_alive2
def check_alive(health):
    return True if health>=1 else False

def check_alive(health):
    if health <=0:
        return False
    elif health==0:
        return False
    else:
        return True

def check_alive(health):
    if health < 1:
        return False
        
    else:
        return True
# I dont know why 1 worked.. I shuffled throught whole numbers beggining from -10 to 10 and 1
# happened to be the number at which the code worked. Any reasons as to why this worked they way it did?


def check_alive(health):
    if health >= 1:
        return True
    if health <= 0:
        return False

def check_alive(health):
    if (0<health<=10):
        return True 
    else:
        return False

def check_alive(health):
    val=True
    if health<= 10 and health>=-10:
        if health>0:
            return(True)
        else:
            return (False)
    else:
        return('Nombre non effectif')


def check_alive(health = 0):
    return health > 0

def check_alive(health):
    if -11< health <1:
        return False
    elif 0<health<11:
        return True

#Defines the function
def check_alive(health):
#Checks if health parameter is less than or equal to 0.
    if health <= 0:
#if health is less than or equal to 0 you would be dead. So returns false
        return False
    else:
#if health is greater than zero you would not be dead. So returns true.
        return True

def check_alive(health):
    if health > 0:
        return True
    else:
        return False
    
    
    
    
    #if():
    #    health <= 0
#return False
    #else:
      #  return True


def check_alive(health):
    if health > 0:
        return True
    else:
        return False
check_alive(-10)

def check_alive(health):
    if health <= 0:
        return bool(False)
    else:
        return bool(True)

def check_alive(health):
    if health <= 0:
        return False
    else:
        return True
    #pogchamp


def check_alive(health):
    if health >0 and health <=10:
        return True
    elif health <=0 and health >=(-10):
        return False

def check_alive(health):
    while -10 <= health <=10:
        if health <= 0:
            return False
        else:
            return True

def check_alive(health):
    if health < 0 or health <= 0: #checking health less than 0 for - integer and less than equal to zero
        return False
    else:
        return True

def check_alive(health):
    if health<=0:  #dont forget to add a semicolon
        return False #make sure its capital
    else:
        return True

def check_alive(health):
    if health <= 10 or health >= -10: 
        if health > 0:
            return True
        else:
            return False
        return Error

def check_alive(health):
    if health <= 0 and health >= -10:
        return False
    elif health > 0 and health <=10:
        return True
    else: 
        return "Impossible!"

def check_alive(health):
    #if(health <= 0):        
    #    return False
    #else:
    #    return True
    return True if health > 0 else False

def check_alive(health):
    if(health < 0):
        return False
    if(health == 0):
        return False
    else:
        return True

1=="true"
0=="false"
def check_alive(health):
    if health <= 0:
        return 0
    else:
        return 1

def check_alive(health):
    if health > 0 <= 10:
        return True
    else:
        return False

def check_alive(health):
    if health == 0 or health < 0:
        return False
    else:
        return True

def check_alive(health):
    if health <= 0:
        return 1!=1 
    else:
        return 1==1 
print (check_alive(4))

def check_alive(health):
    alive = 0
    if health > 0:     
        alive = 1
    return alive

def check_alive(health):
#     if health <= 0:
#         return False
#     else:
#         return True
    return False if health <= 0 else True

def check_alive(health):
    if(health <= 0):
#         health < 0
        return False
    else:
        return True

def check_alive(health):
    if health <= 0:
        return False
    else:
        return True

print((check_alive(-1)))


def check_alive(health:float):
  if health <= 0:
    return False
  else:
    return True    

def check_alive(health):
    if (health == 0):
        return False
    if(health < 10 and health > 0) or (health < 0 and health < -10):
        return True
    else:
        return False

def check_alive(h):
    
    return True if h>0 else False

def check_alive(health):
    if health <= 0:
        return False
    else:
        return True
    
print(check_alive(3))

def check_alive(health):
    return (health>=1 and health<=10)

def check_alive(health):
    if(health <= 0 and health >= -10):
        return False
    elif (health > 0 and health <= 10):
        return True
    else:
        print("Put a correct number")

def check_alive(h):
    return h>0

def check_alive(health):
    if (health == 0):
        return False
    else:
        if (health < 0):     
            return False
        else:
            return True

def check_alive(health):
    Heal = True
    if health <= 0:
        Heal = False
    return Heal

def check_alive(x):
    if x <= 0:
        return False
    else:
        return True

def check_alive(health):
    if health<=0:
        return False
    else:
        return True
    return health
check_alive(9)

def check_alive(health):
    if health <= 0:
        return (False)
    else :
        return (True)
    
check_alive(10)

def check_alive(health):
    return health > 0 and True

def check_alive(health):
    if health >0:
        x = True
    else:
        x = False
    return x

def check_alive(health):
    if health >= 1:
        return True
    elif health <= 0:
        return False

def check_alive(health):
    alive = True
    
    if health <= 0:
        alive = False
        
    return alive
        
        


def check_alive(health):
    if health > 0:
        return True 
    if health <= 0:
        return False

def check_alive(health):
    if health <10 and health>-10:
        if health <= 0:
            return False
        else:
            return True

def check_alive(health):
    if health >= -10 & health <= 10: 
        if health > 0:
            return True
        else:
            return False 

def check_alive(health):
    x = True
    y = False
    if health < 1:
        return y
    else:
        return x

def check_alive(health):
    check=(health>0)
    return check

def check_alive(health):
    if health >= 0 and health != 0:
        return True
    else: 
        return False

def check_alive(health):
    return False if health <= 0 else True
    #if health <= 0:    return False
    #else:    return True


def check_alive(health):
    '''the format supplied is garbage and not pythonic. Let us make it more elegant'''
    '''Also, Trump sucks'''
    return False if health <=0 else True

def check_alive(health):
    # the folowing line checks if the user's health is less than or equal to 0.
    if health <= 0:
        result = False
    # the following line will be used if line 3 is false.
    else:
        result = True
    return result

def check_alive(health):
    return 0 < health

def check_alive(health):
    if health < 10 and health > 0:
        return True
    else:
        return False

def check_alive(health):
      if ((health >= -10) and (health <= 10) ):
            if(health > 0): 
                return True
            else: 
                if(health <=  0):
                    return False

def check_alive(hp):
    if hp <= 0:
        return False
    else:
        return True
    
test=check_alive(1)

def check_alive(health):
    if health >= 1:
        return True
    else:
        return False
    return check_alive

def check_alive(health):
    if(health >= -10) and (health <= 10):
        if health <= 0:
            return False
        else:
            return True

def check_alive(health):
    if health >= -10 and health <= 10:
        if health > 0:
            return True
        else:
            return False
    else:
        return False

def check_alive(health):
    if(health<=0):
        return False
    else:
        return True
    
check_alive(-2)

def check_alive(health):
    if health <= 0:
        return health != health
    else:
        return health == health

def check_alive(health):
    if health >= 1:
        return True
    else: 
        health <= 0
        return False

def check_alive(health):
    if health <= 0:
        return False
    else:
        return True

print(check_alive(-7))

def check_alive(health):
    return 0 if health <= 0 else 1

def check_alive(health):
    
    if(health <= 0):
        return False
    else:
        return True
    
    maximum(-10, 10)

def check_alive(health):
    if health <= 0 or health is None:
        return False
    elif health > 0:
        return True

def check_alive(health):
    return health > 0 if health in range(-10,10) else False

def check_alive(health):
    # Check if health ess or equal to 0
    if health <= 0:
        return False
    # Else
    else:
        return True

def check_alive(health):
    if(health > 0):
        return 1
    else:
        return 0

health = 0
def check_alive(health):
    if health > 0:
        return True
    else:
        return False
check_alive(health)

def check_alive(health):
    if health <= 0 and health >= -10:
        return False
    elif health > 0 and health <= 10:
        return True

def check_alive(health):
    if health <= 0: #needs = because 0 health is also not alive!
        return False
    else:
        return True    #True and False need uppercase