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 = {2:-3,1:-1,10:-9}
b = -1.3
c = 'OBD Perr Leaf'
d = list(range(9))
e = -9
ExpressionYour Answer
1. b - -2.0 0.7
2. str((7 not in d and True)) 'False'
3. ((list(a.items()) * abs(e))).index((2, -3)) 0
4. (not c.isalpha()) == False False
5. e / e 1.0
6. d[0:7] [0, 1, 2, 3, 4, 5, 6]
7. a.get(-1,10) 10
8. b - b 0.0
9. (c.split('f').count('')) ** 2 1
10. str(3 not in d) 'False'
Check Answers