Quick actions

cmd+k|ctrl+k

Navigation

Languages

Daily Coding Problem #5

Snippet info

Language

Python

Visibility

public

Author

idosomedailycodingproblems

Created

2022-12-20T16:50:57.463593Z

Updated

2022-12-20T16:55:45.413699Z

def cons(a, b):
    def pair(f):
        return f(a, b);
    return pair;

def car(pair):
    def first(a, b):
        return a;
    return pair(first);
def cdr(pair):
    def last(a, b):
        return b;
    return pair(last);

print(car(cons(3, 4)));
print(cdr(cons(3, 4)));
INFO