#{}{}#' #{}{}#' #{}{}#' #{}{}#' #{}---{}#' #{}-{}#' ##'index has no { #{}-{}#' #{}---{}#' #{}{}#' #{}{}#' #{}{}#' #{}{}#' #{}---{}#' #{}-{}#' # <use this to measure the number of spaces try print('dna animationby al sweigart al@inventwithpython com' print('press ctrl- to quit ' time sleep( rowindex while truemain program loop increment rowindex to draw next row rowindex rowindex if rowindex =len(rows) rowindex row indexes and don' have nucleotides if rowindex = or rowindex = print(rows[rowindex] continue select random nucleotide pairsguanine-cytosine and adenine-thymine randomselection random randint( if randomselection = leftnucleotiderightnucleotide ' '' elif randomselection = leftnucleotiderightnucleotide ' '' elif randomselection = leftnucleotiderightnucleotide ' '' elif randomselection = leftnucleotiderightnucleotide ' '' print the row print(rows[rowindexformat(leftnucleotiderightnucleotide) time sleep(pauseadd slight pause except keyboardinterrupt sys exit(when ctrl- is pressedend the program project #