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 = -9
b = 'jert Ogma turf'
c = True
d = [[0.7,2.5],[2,-9],list(range(2,8))]
e = {-5:-6}
ExpressionYour Answer
1. str(len(e)) '1'
2. c or c True
3. str(c) 'True'
4. b.find('m') 7
5. round(a / -5 + -2.0, 3) -0.2
6. (d[1:2:3][0:1]) + list(range(7,9)) [[2, -9], 7, 8]
7. b.split('j') ['', 'ert Ogma turf']
8. str((not c and c)) 'False'
9. e.get(-6,-5) -5
10. e.get(-6,-5) -5
Check Answers