Comp 115 Programming Assignment 04: Palindromic Sequences

Due 11:59pm Wednesday, April 15 2020

You are required to work on this lab in teams of two. You must complete this lab with your teammate only, although you may discuss lab concepts with other students. Please keep the Academic Integrity Policy in mind---do not show your code to anyone outside of the professors and tutors, and do not look at anyone else's code for this lab. If you need help, please post a question on Piazza, or contact the professor.

In this project, you will practice computing with strings, if statements and loops. You will also use comments to explain the structure of your program. Save your code in a file whose name consists of the first letter of your first name followed by your last name and Prg4. For example, if I submitted an assignment, I would name the file mgagnePrg4.py.

The video I created for this assignment can be seen here, and you can see the notes I wrote during that video here.

The Problem

DNA is composed of 4 nucleotides: A, C, T and G, and the A always binds with the T, the C always binds with the G. A DNA sequence forms a palindromic sequence (they are real, I swear, they are thought to play a role in gene activation) if its first half can bind with its second half. For example, "ACCTAGGT" is a palindromic sequence.

Geno-Thingy is a biotech company that analyses DNA. They would like a program that will tell them if a sequence of DNA is a palindromic sequence.

Input

The program should ask the user for a string containing a DNA sequence.

Unfortunately, Geno-Thingy's equipment is a little faulty so there could be non-DNA characters in the input.

For example, a possible input could be "AGb TTA-GC*C ACAT". So one of your first tasks will be to 'clean up' this input by removing all the characters that are not 'A', 'C', 'T' or 'G' (lower case variants of these lettesr should also be removed).

Output

The program should print one of the following. Either:

For example: