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
jenyasd209 [6]
3 years ago
11

Done through Block Py/ Python

Computers and Technology
1 answer:
34kurt3 years ago
3 0

Answer:

Following are the code to this question:

def rate_animal(an_animal):#defining method rate_animal

   if an_animal=="cat":#defining if block to check valu

       return 1 #return value 1

   elif an_animal=="dog":# defining elif block to check another value

       return 2 #return value 2

   elif an_animal=="capybara":# defining elif block to check another value

       return 3 #return value 3

   elif an_animal=="danger noodle":# defining elif block to check another value

       return 4 #return value 4

   else:

       return -1 #return value -1

print("dog Rating: ",rate_animal("dog"))#calling method and print its return value

print("cat Rating: ",rate_animal("cat"))#calling method and print its return value

print("capybara Rating: ",rate_animal("capybara"))#calling method and print its return value

print("danger noodle Rating: ",rate_animal("danger noodle"))#calling method and print its return value

print("Horse Rating: ",rate_animal("horse"))#calling method and print its return value

Output:

dog Rating:  2

cat Rating:  1

capybara Rating:  3

danger noodle Rating:  4

Horse Rating:  -1

Explanation:

Description of the python code can be defined as follows:

  • In the above program code, a method "rate_animal" is declared, in which a string variable "an_animal" passes as the argument, inside the method, multiple conditional statements are used.
  • In the if the block, it will check string value if it equal to "cat", it will return 1, otherwise, it will go to elif block, in this block it will check value is  "dog", "capybara", and "danger noodle", if the value is any of then it will return 2, 3, and 4.
  • If the above condition is not true, it will return a value, that is "-1", in the next step print method is used, that calls the method and print its return value.
You might be interested in
Stress is an illness not unlike cancer.<br> True<br> False
LiRa [457]

Answer:

... not unlike cancer.

Explanation:

so we have a double negative so it makes it a positive, so that would basically mean like cancer

so false i think

8 0
3 years ago
Read 2 more answers
What type of malicious software masquerades as legitimate software to entice the user to run it?
Vlada [557]

Answer:

Trojan horse

Explanation:

A Trojan horse is malicious software that masquerades as a legitimate computer program such as a video game, image file, utility program, or even an antivirus so as to entice the user to run it, thereby allowing an attackers (the developer of the malicious program) to gain access to the data on the computer in an illegal manner.

4 0
3 years ago
Which of the following is not an acceptable way to code a nested structure? Select one: a. nest a for loop inside a while loop b
kirill115 [55]

Answer:

nest an else clause within an elif clause

Explanation:

in python Programming, we cannot nest an else clause within an elif clause. elif is actually else if condition. we cannot nest another else with in elif clause.

8 0
3 years ago
In most signal "timing diagrams" (like the one below) the signals do not change from low to high, or from high to low, abruptly.
melisa1 [442]

Explanation:

This transient state occurs due to the fact that the signal change from low to high and high to low doesn't occur intermediately but in a very small time, in relation to the signal time itself.

At transistor level there are parasitic (undesired) capacitances and resistances, formed due to the layout configuration of conductor and dielectrics. As consequence a RC circuit is formed, thus making a propagation delay.

This delay must be characterized for each circuit, and specified as tpHL (transition time from High to Low) and tpLH (transition time from Low to High)

8 0
3 years ago
PLZ HELP 100 points!!!! 1. Imagine you are a screenplay writer. Discuss some possible activities or techniques you
atroni [7]

Answer:

One angle

Explanation:

I have seen several scripts with various directions such as "Close on" "from another angle", etc. And other scripts without such notations. I have seen conflicting comments concerning this practice---Some producers I have contacted say they want this IN the "finished script" they get and others, feel, like I do, that camera angles and lighting and such are up to the director in the production phase. I have also read that Spec Scripts do not have such notations. So what should I include or not, in this respect, in a Spec Script.

5 0
4 years ago
Other questions:
  • which of these should be reportable diseases to protect public health? A. Obesity B. Diabetes C.Measles D. Lung Cancer
    10·2 answers
  • What is a society that has moved to the internet Rather than relying on physical media called
    11·1 answer
  • Why do i have to wait and watch videos
    11·1 answer
  • Extending the web server functionality implies that the web server and the web-to-database middleware will properly communicate
    10·1 answer
  • Which type of microscope can only be used to view non-living specimens?
    10·2 answers
  • How many bytes are there in 256 Kbytes?
    6·1 answer
  • Select the correct answer.
    9·1 answer
  • I’ll give brainliest if answers are correct
    11·1 answer
  • Which type of wireless attack is designed to capture wireless transmissions coming from legitimate users
    6·1 answer
  • In the context of in-house software development options, a firm that enhances a commercial package by adding custom features and
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!