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 = -0.4
b = 8
c = 'Tshi RCA'
d = False
e = [2]
ExpressionYour Answer
1. c.strip() 'Tshi RCA'
2. not (b <= -1.4 and d) True
3. (len(c.split('T'))) / b 0.25
4. int(a) // b 0
5. e + [2 not in e,[False,True,True,str(d)],e[0:1:2],[{1:[3],5:e,0:e}]][2:4] [2, [2], [{1: [3], 5: [2], 0: [2]}]]
6. (str(c.isdigit()))[2] 'l'
7. c.split() ['Tshi', 'RCA']
8. (str(d == False)).isdigit() False
9. str(int(a)) '0'
10. c.find('i') 3
Check Answers