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 = True
c = 'Gari puli shpt'
d = [[a + 3,str(a),str(a),a == -1.2],list(range(7,8,4)),list(range(8,10))]
e = 2.1
ExpressionYour Answer
1. c.split('h')[0:1:3] ['Gari puli s']
2. str((not c.isalpha())) 'True'
3. (a / 1 >= a) == False False
4. d.count([7]) % (1+1) 1
5. round(a / 6 - e, 0) -1.0
6. str(b).find('u') 2
7. e == e or True True
8. int(e) // -5 -1
9. (str([12, '9', '9', False] not in d)).islower() False
10. str(b) 'True'
Check Answers