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 = list(range(5))
b = -1.8
c = False
d = 'vare Rhne hajj'
e = {-3:a,4:[-5,7,[d.find('R'),d.isdigit()]],0:list(range(7,10))}
ExpressionYour Answer
1. d.strip(' ') 'vare Rhne hajj'
2. not (not b < -2.0) False
3. len(d) / -4 -3.5
4. str(c) 'False'
5. str(c) 'False'
6. (a * abs(0)) []
7. len(e) 3
8. int(b) -1
9. not (d.isupper() or False) True
10. (str(int(b))).find('-') 0
Check Answers