''' Exercise A: Predict True or False For the 3 pieces of code below, predict whether they will return True or False without running the code. To check whether your prediction is correct, run the code with the needed print() statements. ''' # Code 1 gfp_prot_seq = "" pred1 = bool(gfp_prot_seq) # Your prediction for pred1 = True or False? # Code 2 gfp_prot_seq = "MSKGEELFTGVVPILVELDGDVNGHKFSVSGEGEGDATYGKLTLKFICTTGKLPVPWPTLVTTFSYGVQCFSRYPDHMKQHDFFKSAMPEGYVQERTIFFKDDGNYKTRAEVKFEGDTLVNRIELKGIDFKEDGNILGHKLEYNYNSHNVYIMADKQKNGIKVNFKIRHNIEDGSVQLADHYQQNTPIGDGPVLLPDNHYLSTQSALSKDPNEKRDHMVLLEFVTAAGITHGMDELYK" pred2 = bool(gfp_prot_seq) # Your prediction for pred2 = True or False? # Code 3 animal = "rabbit" mammals = ["giraffe", "elephant", "lion", "rabbit", "guinea pig", "vole", "shrew", "human", "cat", "dog"] reptiles = ["crocodile", "iguana", "alligator", "boa", "cobra", "python", "anole", "turtle", "tortoise", "tuatara"] pred3 = animal in mammals # Your prediction for pred3 = True or False? ''' Exercise B: Code debugging Statements in each of the 3 pieces of code below should be true. Understand why they are not, and fix the code. ''' # Code 1 x = 1.4 * 1.5 print(f"Is x = 2.1? {bool(x == 2.1)}") # Code 2 y = 'a' + 7 test_ar = ['a', 'b', 'c', 'd', 'e', 'f', 'g'] print(f"Is y in the test_ar? {bool(y in test_ar)}") # Code 3 test_ar = ['a', 'b', 'c', 'd', 'e', 'f', 'g'] z = 7 print(f"Is z longer than the test array? {bool(z > len(test_ar))}")