Question: CODE USING PYTHON ( python 3 preferred) PLEASE: Be sure to write clear comments throughout when coding this and make sure the code passes the

CODE USING PYTHON ( python 3 preferred) PLEASE:

Be sure to write clear comments throughout when coding this and make sure the code passes the unit test. Both images task of the assignment and the unit test are attached below. I'm not sure but It may involve using dictionaries, lists, list comprehensions. Make sure it isn't too advanced either; something that a person that's taking an intro to python course could do. Just use your better judgment please and thank you.

CODE USING PYTHON ( python 3 preferred) PLEASE: Be sure to writeclear comments throughout when coding this and make sure the code passes

import ass4 import unittest # A subclass of unittest.TestCase cLass Ass4Test(unittest. TestCase): def test_empty_strands(seLf): self.assertEqual (ass4.hamming_distance("", ""), e) def test_identical_strands (self): self.assertEqual (ass4.hamming_distance("A", "A"), e) def test_long_identical_strands (seLp: self.assertEqual(ass4.hamming.distance("GGACTGA", "GGACTGA"), ?) def test_complete_distance_in_single_nucleotide_strands(seLf): self.assertEqual (ass4.hamming_distance("A", "G), 1) def test_complete_distance_in_small_strands (seLf): seLf.assertEqual (ass4.hamming_distance("AG", "CT), 2) def test_small_distance_in_small_strands (seLf): seLf.assertEqual (ass4.hamming_distance("AT", "CT), 1) def test_small_distance(seLf): self.assertEqual (ass4.hamming_distance("GGACG, "GGTCG"), 1) def test_small_distance_in_long_strands (seLf): self.assertEqual (ass4.hamming_distance("ACCAGGG "ACTATGG"), 2) def test_non_unique_character_in_first_strand(seLf) seLf.assertEqual (ass4.hamming_distance("AAG", "AAA" 1) def test_non_unique_character_in_second_strand (seLf) self.assertEqual (ass4.hamming_distance("AAA", "AAG 1) def test_same_nucleotides_in_different_positions (seLf): self.assertEqual (ass4.hamming_distance("TAG", "GAT" 2) def test_large_distance(seLf): self.assertEqual (ass4.hamming_distance("GATACA", "GCATAA"), 4) def test_large_distance_in_off_by_one_strand(seLf): seLf.assertEqual (ass4.hamming_distance("GGACGGATTCTG", "AGGACGGATTCT"), 9) def test_disallow first_strand_longer(seLp): with self.assertRaiseswithMessage (ValueError) ass4.hamming_distance("AATG, "AAA") def test_disallow_second_strand_longer(self): with self.assertRaiseswithMessage (ValueError) ass4.hamming_distance("ATA, "AGTG")

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!