I've got a crazy mental illness.
I dislike numbers a lot. But it's a little complicated:
The number I'm afraid of depends on which day of the week it is...
This is a concrete description of my mental illness:

Monday     --> 12

Tuesday    --> numbers greater than 95

Wednesday  --> 34

Thursday   --> 0

Friday     --> numbers divisible by 2

Saturday   --> 56

Sunday     --> 666 or -666


Write a function which takes a string (day of the week) and an integer (number to be tested) so it tells the doctor if I'm afraid or not. (return a boolean)

Difficulty: introductory

Starter code:

def am_I_afraid(day,num):
	

Solutions:
def am_I_afraid(day,num):
    return {
        'Monday':  num == 12,
        'Tuesday': num > 95,
        'Wednesday': num == 34,
        'Thursday': num == 0,
        'Friday': num % 2 == 0,
        'Saturday': num ==  56,
        'Sunday': num == 666 or num == -666,
    }[day]


afraid = {
    'Monday': lambda x: x == 12,
    'Tuesday': lambda x: x > 95,
    'Wednesday': lambda x: x == 34,
    'Thursday': lambda x: x == 0,
    'Friday': lambda x: x % 2 == 0,
    'Saturday': lambda x: x == 56,
    'Sunday': lambda x: abs(x) == 666,
}

def am_I_afraid(day, num):
    return afraid[day](num)

def am_I_afraid(day, x):
    return {'Mo': x       == 12,
            'Tu': x       >  95,
            'We': x       == 34,
            'Th': x       ==  0,
            'Fr': x % 2   ==  0,
            'Sa': x       == 56,
            'Su': abs(x)  == 666}[day[:2]]

def am_I_afraid(day,num):
    if day=="Monday": return num==12
    if day=="Tuesday": return num>95
    if day=="Wednesday": return num==34
    if day=="Thursday": return num==0
    if day=="Friday": return num%2==0
    if day=="Saturday": return num==56
    if day=="Sunday": return num==666 or num==-666

FUNCS = dict(zip('Monday Tuesday Wednesday Thursday Friday Saturday Sunday'.split(),
                (12..__eq__, 
                 95..__lt__,
                 34..__eq__,
                 0..__eq__, 
                 lambda n: not n%2,
                 56..__eq__,
                 lambda n: abs(n)==666)))

def am_I_afraid(day,n):
    return FUNCS[day](n)

def am_I_afraid(day,num):
    #your code here
    rep = False
    lst1 = [('monday', 12), ('wednesday', 34), ('thursday', 0), ('saturday', 56),  ('sunday', 666), ('sunday', -666)]

    input = (day.lower(), num) 
    
    if input in lst1 or (input[0]=='tuesday' and input[1]>95) or (input[0]=='friday' and input[1]%2==0):
        rep = True
    return rep

def am_I_afraid(day,num):
    return {'Monday'    : num == 12, 
            'Tuesday'   : num > 95, 
            'Wednesday' : num == 34, 
            'Thursday'  : not num, 
            'Friday'    : not (num % 2), 
            'Saturday'  : num == 56, 
            'Sunday'    : num == 666 or num == -666
           }[day]

afraid = {
    "Monday": lambda n: n == 12,
    "Tuesday": lambda n: n > 95,
    "Wednesday": lambda n: n == 34,
    "Thursday": lambda n: n == 0,
    "Friday": lambda n: n % 2 == 0,
    "Saturday": lambda n: n == 56,
    "Sunday": lambda n: abs(n) == 666,
}

def am_I_afraid(day, num):
    return afraid[day](num)

def am_I_afraid(day, num):
    return {"Monday": num == 12,
            "Tuesday": num > 95,
            "Wednesday": num == 34,
            "Thursday": num == 0,
            "Friday": num % 2 == 0,
            "Saturday": num == 56,
            "Sunday": abs(num) == 666
            }[day]


def am_I_afraid(day,num):
    if day == "Monday" and num == 12:
        return True
    if day == "Tuesday" and num > 95:
        return True
    if day == "Wednesday" and num == 34:
        return True
    if day == "Thursday" and num == 0:
        return True
    if day == "Friday" and num % 2 == 0:
        return True
    if day == "Saturday" and num == 56:
        return True
    if day == "Sunday" and abs(num) == 666:
        return True
    return False