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
Gps receivers are commonly used by individuals to determine their geographic location while hiking and to obtain driving directi
soldier1979 [14.2K]
I think it is true also.
7 0
3 years ago
A server technician has been tasked with purchasing cables and connectors for a new server room. The server room consists of one
Rama09 [41]

Answer:

The answer is "Option b"

Explanation:

A straightforward cable is a form of twisted pair cable, which is used in the  LAN cable, it provides the connections to RJ-45 cable, that pinout to each end for the same connection. In this cable, that is a sequel, the same kind of computer was interlinked for used by the same routers ports, that's why the technician purchase this cable, and certain options were incorrect that can be described as follows:

  • In option a, It is used in the television, that's why it is wrong.
  • Option c and Option d both were wrong because It is used in telephones, that provides low-speed apps, and it terminates the network.
5 0
2 years ago
What are so good free movie apps or websites
noname [10]

Some free movie websites and apps are:



Crackle


Tube TV


Popcornflix


Viewster


Snagfilms


And Pluto TV


Hope I helped

8 0
3 years ago
Read 2 more answers
g Write a recursive function all capital (L,start ,stop) that takes a string L and two integers. It returns a Boolean (True/Fals
Anton [14]

Answer:

def recursive(L, start, stop):

         y = L[start:stop]

         print(y.isupper())

recursive("ALLow", 0, 3)

Explanation:

The code is written in python.

def recursive(L, start, stop):

The function is defined known as recursive. The function takes a string and 2 integers known as start and stop. The parameter L is a string and the other 2 parameter start and stop are integers which indicates the index range of the string L.  

y = L[start:stop]

A variable y is declared to store the string L with the index range from start to stop . Note start and stop are integers.

print(y.isupper())

The code prints True if the index range of the string L are all upper case else it print False.

recursive("ALLow", 0, 3)

This code calls the function with the required parameters L(string), Start(integer) and stop(integer)

 

8 0
3 years ago
Which of the following is the term for the topmost folder in a directory?
kupik [55]
Hello <span>Pouerietzach
</span><span>
Question: Which of the following is the term for the topmost folder in a directory?

Answer: Root Folder (A)

Hope That Helps!
-Chris</span>
8 0
3 years ago
Read 2 more answers
Other questions:
  • I want to know all the part of computer system
    14·1 answer
  • What is data anayltics
    5·1 answer
  • Assuming a computer has a single processor and a single core with no support for parallel execution, explain why running a multi
    11·1 answer
  • Why is it important to use random assignment when determining which research participants will comprise the different treatment
    12·1 answer
  • A technique for identifying and tracking assets using technologies such as RFID and smart cards is known as electronic tagging.
    6·1 answer
  • Travis just got promoted to network administrator after the previous administrator left rather abruptly. There are three new hir
    14·1 answer
  • I'm in Paris and want to take a picture of my mom in front of the Eifel Tower. I want both her and the tower to be in sharp focu
    14·2 answers
  • Why is the yellow light blinking on the front of my computer
    10·1 answer
  • DEFINE Problem:
    11·1 answer
  • A Chain of dry-cleaning outlets wants to improve its operations by using data from devices at individual locations to make real-
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!