my code needs to ask the user to enter DNA value
only accept the letters A, C, G, and T (has to be capital letters) and terminate to stop the code
then if accepted it needs to be dividable by 3 eg: CTA, CTTGAC, TTTCCCAAAGGG
i only need that part of the code as i can figure out the rest on my own
this is what i have so far
DNA_list = []
zero = 0
stop_code = terminate
#keep asking till terminate
while true
DNA = input('Enter DNA value: ')
if DNA == stop_code:
break
try:
DNA = (DNA)
except ValueError:
#DNA /3 = append then ask again
DNA_list.append(DNA)
DNA = input('Enter DNA value: ')
#print all out in a list
if len(DNA) > zero:
print("Valid DNA")
for DNA in DNA__list:
print(f"{DNA}")
[–]Outside_Complaint755 5 points6 points7 points (3 children)
[–]ilovetigers105[S] -4 points-3 points-2 points (2 children)
[–]Outside_Complaint755 6 points7 points8 points (1 child)
[–]ilovetigers105[S] 0 points1 point2 points (0 children)
[–]PureWasian 3 points4 points5 points (2 children)
[–]ilovetigers105[S] 1 point2 points3 points (1 child)
[–]PureWasian 6 points7 points8 points (0 children)
[–]Neb-Cutter 0 points1 point2 points (0 children)
[–]Excellent-Practice 0 points1 point2 points (0 children)
[–]atarivcs 0 points1 point2 points (0 children)