#user asked for input that contains a t c g
print("ENTER THE GENETIC CODE - MUST INCLUDE THE FOLLOWING DNA ELEMENTS A - T -C - G")
string1 = input("SPECIES 1: ")
string1 = string1.upper()
print(string1)
#while loop to check for conditions
while "A" not in string1 and "T" not in string1 and "C" not in string1 and "G" not in string1:
print("ENTER THE GENETIC CODE - MUST INCLUDE THE FOLLOWING DNA ELEMENTS A - T -C - G")
string1 = input("SPECIES 1: ")
string1 = string1.upper()
print(string1)
print("ENTER THE GENETIC CODE - MUST INCLUDE THE FOLLOWING DNA ELEMENTS A - T -C - G")
string2 = input("SPECIES 2: ")
string2 = string2.upper()
print(string2)
while "A" not in string2 and "T" not in string2 and "C" not in string2 and "G" not in string2:
print("ENTER THE GENETIC CODE - MUST INCLUDE THE FOLLOWING DNA ELEMENTS A - T -C - G")
string2 = input("SPECIES 1: ")
string2 = string2.upper()
print()
print("SPECIES 1: ",string1)
print("SPECIES 2: ",string2)
Asked
Active
Viewed 54 times
0
-
1What output you are expecting and what you got? – AriaN Dec 20 '20 at 19:05
-
I am confused why the while loop is not working it will take any characters. I want to to continue to ask for inputs until A T C G are included in the inputs. Thanks - AriaN – Tala Dec 20 '20 at 19:19
-
What is your question? Welcome to SO. This isn't a discussion forum or tutorial. Please take the [tour] and take the time to read [ask] and the other links found on that page. Invest some time with [the Tutorial](https://docs.python.org/3/tutorial/index.html) practicing the examples. It will give you an idea of the tools Python offers to help you solve your problem. – wwii Dec 20 '20 at 19:22
-
[Formatting help](https://stackoverflow.com/editing-help)... [Formatting sandbox](https://meta.stackexchange.com/questions/3122/formatting-sandbox) – wwii Dec 20 '20 at 19:23
-
1Related:[Asking the user for input until they give a valid response](https://stackoverflow.com/questions/23294658/asking-the-user-for-input-until-they-give-a-valid-response) – wwii Dec 20 '20 at 19:25