COSC 101 expression practice (beta!)

Report any problems to jsommers@colgate.edu

Generate expressions using these types:






# Assume the following assignments have been made in Python
a = False
b = {6:-1.5}
c = 5
d = -0.5
e = [d != d,d <= d,d - c]
ExpressionYour Answer
1. int(d) 0
2. 6 not in b != a False
3. ((list(b.keys())[0:1:1]) * abs(c)) [6, 6, 6, 6, 6]
4. list(b.items()) [(6, -1.5)]
5. str(len(e)) '3'
6. -(c / c + -1.0) -0.0
7. not not a False
8. int(d + c) 4
9. e[0] True
10. str(a) 'False'
Check Answers