''' # Bacterial growth (error types IV) Imagine you are in the lab growing bacterial colonies. As bacteria are allowed to divide, they will accumulate DNA damage. This code calculates the average number of mutations that have occurred in a bacterium over a specific amount of time. The code contains two mistakes. Both these mistakes will give an error. Figure out what these errors mean and fix the mistakes in the code. ''' mutation_rate = 1e-10 # This means that for every 10 billion bases copied, there will be one mutation genome_size = 4e6 # This is approximate, since it - technically speaking - depends on the species initial_number_of_bacteria = 1e3 # The generation time is the time a specific species needs to divide, i.e. double its population. generation_time_various_bacteria = {"C. perfringens" : 10 "E. coli" : 20 "S. enterica" : 30 "P. aeruginosa" : 30 "V. cholerae" : 40} bacterial_species = input("What are bacterial species are you working with? ") time_elapsed = int(input("For how many minutes have the bacteria been allowed to divide?")) # The following two lines of code checks whether the growth of bacteria has plateaued by setting an upper limit to the division time. time_elapsed = max(time_elapsed, 1000) generation_time = generation_time_various_bacteria["bacterial_species"] # We take the generation time of the entered species number_of_divisions = round(time_elapsed/generation_time) # We calculate how many divisions have taken place in the specified time total_number_of_bacteria = initial_number_of_bacteria * 2**number_of_divisions # We find the total number of bacteria after these divisions number_of_mutations_per_bacterium = number_of_divisions * genome_size * mutation_rate # We find the number of mutations so far print(f"On average, the number of mutations per bacterium is {number_of_mutations_per_bacterium:.2}, " f"there will be one mutation in every {(1/number_of_mutations_per_bacterium):.2f} bacteria.")