1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
oee [108]
3 years ago
12

1. Write a program to prompt the user to enter a single character and respond back whether or not the character is valid dna. 2.

Write a program to prompt the user to enter a single character and respond back whether or not the character is valid rna. 3. Write a program to prompt the user to enter a dna sequence and respond back whether or not the sequence is valid. 4. Write a program to prompt the user to enter a rna sequence and respond back whether or not the sequence is valid.
Computers and Technology
1 answer:
Nina [5.8K]3 years ago
7 0

Answer:

Answer 1:

dna = input("Enter DNA type: ")

dna = dna.upper()

print(dna)

if dna == "A" or dna == "B" or dna == "Z":

   print("valid")

else:

   print("invalid")

Answer 2:

rna = input("Enter DNA type: ")

rna = rna.lower()

print(rna)

if rna == "m" or rna == "t" or rna == "r":

   print("valid")

else:

   print("invalid")

Answer 3:

dnaSquence = input("Enter the DNA sequence: ")

type = "valid"

for char in dnaSquence:

   if char not in ["A", "C", "G", "T"]:

       type = "invalid"

       break

print(type)

Answer 4:

rnaSquence = input("Enter the RNA sequence: ")

type = "valid"

for char in rnaSquence:

   if char not in ["A", "C", "G", "U"]:

       type = "invalid"

       break

print("valid")

Explanation:

There are three types of DNA; Type A, Type B and Type Z.

A DNA sequence consists of; A, C, G and T.

There are three types of RNA; mRNA, tRNA and rRNA.

An RNA sequence consists of; A, C, G and U.

Code Explanations:

Code 1:

dna = input("Enter DNA type: ")

dna = dna.upper()

print(dna)

if dna == "A" or dna == "B" or dna == "Z":

   print("valid")

else:

<em>    print("invalid")</em>

  1. prompts and Takes a single character input
  2. converts the character to upper case
  3. compares the input to the DNA types
  4. Prints "valid" for a valid input else prints "invalid"

Code 2:

rna = input("Enter DNA type: ")

rna = rna.lower()

print(rna)

if rna == "m" or rna == "t" or rna == "r":

   print("valid")

else:

<em>    print("invalid")</em>

<em />

  1. prompts and Takes a single character input
  2. converts the character to lower case
  3. compares the input to the RNA types
  4. Prints "valid" for a valid input else prints "invalid"

Code 3:

Answer 3:

dnaSquence = input("Enter the DNA sequence: ")

type = "valid"

for char in dnaSquence:

   if char not in ["A", "C", "G", "T"]:

       type = "invalid"

       break

print(type)

  1. It prompts for a DNA sequence.
  2. Declares a string variable "type" and initializes type to valid.
  3. The FOR loop checks every character in the DNA sequence.
  4. If the character is not in the list [A, C, G, T] type becomes invalid and the loop breaks and the type "invalid" is printed to the screen.
  5. if all the characters are in the list, then type will remain valid and will be printed to the screen.

Code 4:

rnaSquence = input("Enter the RNA sequence: ")

type = "valid"

for char in rnaSquence:

   if char not in ["A", "C", "G", "U"]:

       type = "invalid"

       break

print("valid")

  1. It prompts for a RNA sequence.
  2. Declares a string variable "type" and initializes type to valid.
  3. The FOR loop checks every character in the RNA sequence.
  4. If the character is not in the list [A, C, G, U] type becomes invalid and the loop breaks and the type "invalid" is printed to the screen.
  5. if all the characters are in the list, then type will remain valid and will be printed to the screen.

You might be interested in
@anthonydboss23<br><br> it’s goldielove6 <br><br> .....this is not a question everyone ignore this
Readme [11.4K]
No problem I suppose...
7 0
3 years ago
Read 2 more answers
Prompt the user for an automobile service. Each service type is composed of two strings. Output the user's input. (1 pt) Ex: Ent
Svet_ta [14]

Answer:

Required code is given below.

Best Regards,

Please ask if any queries.

Explanation:

#include <stdio.h>

#include <string.h>

int main(void)

{

  char input[100];

  printf("Enter desired auto service:\n");

  scanf ("%[^\n]%*c", input);

  printf("You entered: %s\n",input);

  if(strcmp(input,"Oil change") == 0){

     printf("Cost of oil change: $35\n");

  }

  else if(strcmp(input,"Tire rotation") == 0){

     printf("Cost of tire rotation: $19\n");

  }

  else if(strcmp(input,"Car wash") == 0){

     printf("Cost of car wash: $7\n");

  }

  else{

      printf("Error: Requested service is not recognized\n");

  }

   

  return 0;

}

8 0
3 years ago
Customer A with a Bronze service level package calls in a Critical System Failure at 9:00 AM. Customer B with a Silver service l
inysia [295]
This question depends on what the service level packages have to offer as an agreement. Does this question come with a list of what the service levels have to offer?
4 0
3 years ago
What is impact of Internet<br> in our lives
NeTakaya

Answer:

The Internet has changed business, education, government, healthcare, and even the ways in which we interact with our loved ones—it has become one of the key drivers of social evolution. The changes in social communication are of particular significance.

7 0
3 years ago
Which of the following can indicate what careers will be enjoyable ?
pishuonlain [190]

Answer: c. Interests

Explanation:

A person's interests are things that they love to do because they find those things to be enjoyable for example, gaming, writing or travelling.

To find out what careers a person would find enjoyable therefore, the interests can be looked at because if the person enjoy doing those things without it even being a job then they would probably enjoy those things in a career setting as well. For instance a person who enjoys writing would probably find a career in jornalism to be enjoyable.

5 0
3 years ago
Other questions:
  • Write a program that allows a user to input words at the command line. Your program should stop accepting words when the user en
    10·1 answer
  • Explain the role of the domain name system
    15·1 answer
  • what is it called when you are biying and selling products via electronic channels such as the internet​
    13·2 answers
  • What is thhe name of service included with windows server operating systemthat manages a centralized database containing user ac
    5·1 answer
  • Which of the following is an input device? (Select all that apply)
    13·1 answer
  • What is the name of the advanced warrior race of robots in Doctor Who?
    10·2 answers
  • If you have an equipment failure while driving on an expressway, you should
    8·1 answer
  • The 'WIMP' environment is much more user friendly,why?​
    11·2 answers
  • How do news organizations primarily create revenue?
    12·2 answers
  • PLEASE PLEASE PLEASE PLEASE help me Im completly lost will give brainliest and 50 points
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!