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 = 'alc gory Ger.'
b = False
c = list(range(3))
d = 1.6
e = {-10:list(range(5))}
ExpressionYour Answer
1. (c + [str(b)][1:3]).index(1) 1
2. list(e.items()) [(-10, [0, 1, 2, 3, 4])]
3. (not b or True) != True False
4. d + 1.6 3.2
5. a.lower().upper() 'ALC GORY GER.'
6. 'p' not in ((str(b) * 0)) True
7. str(d < -1.2) 'False'
8. 2 not in c False
9. -d -1.6
10. round(a.find('y') / -3, 2) -2.33
Check Answers