# HW6.py
# Homework 6
#
# UT EID: XXX999, UTCS username: XXXXXXXX
# CS313e, Fall 2013, Dr. P. Cannata
# Department of Computer Science, The University of Texas at Austin --
# Problem 1
# m stands for "it's Monday", t stands for "the next day is Tuesday", and d stands for "I will win a thousand dollars"
print [(lambda (m, t, d) : not (m and (not m or t) and (not t or d)) or d) ((i, j, k)) for i in (False, True) for j in (False, True) for k in (False, True)]
# Problem 2
dept = (('DEPTNO', 'DNAME', 'LOC'), (10, 'ACCOUNTING', 'NEW YORK'), (20, 'RESEARCH', 'DALLAS'), (30, 'SALES', 'CHICAGO'), (40, 'OPERATIONS', 'BOSTON'))
print [ i[1] for i in dept]
# or
print [ i[1] for i in dept[1:]] # This ommits the string "DNAME' from what is printed.