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
daser333 [38]
3 years ago
5

Use python

Computers and Technology
1 answer:
konstantin123 [22]3 years ago
6 0

Answer:

Here is the Python program:

def exec_2(f):

    f()

    f()

   

def exec_4(f):

    exec_2(f)

    exec_2(f)

   

def print_koala():

    print("koala")    

exec_4(print_koala)

Explanation:

The program works as follows:

First method:

def exec_2(f):

f()

f()

any function that is passed into exec_2() will be executed twice without parameters.

Second method:

def exec_4(f):

    exec_2(f)

    exec_2(f)

function exec_4(f) takes in a function f as a parameter and executes the function f 4 times using the function exec_2. At first exec_2(f) call the function f is executed twice and and second exec_2(f) call the function f is again executed twice so the function f executes 4 times in total.

Third method:

def print_koala():

    print("koala")  

a function that prints out the koala once

This function has a print statement which is passed the string koala to print on output screen.

exec_4(print_koala)

function exec_4 is used to print koala four times. This function exec_4 takes as argument the function print_koala() So this works as follows:

exec_4(print_koala)

The body of exec_4 executes as:

exec_2(print_koala)

exec_2(print_koala)

Now at first call to exec_2(print_koala) the program moves to the function exec_2 which executes print_koala()  method twice. Since print_koala() method has a print statement print("koala") so this is executed twice:

koala                                                                                                                                           koala

Now at second call exec_2(print_koala) the program moves to the function exec_2 which executes print_koala()  method twice again. Since print_koala() method has a print statement print("koala") so this is executed again twice:

koala                                                                                                                                           koala

So the output of the entire above program is:

koala                                                                                                                                           koala                                                                                                                                           koala                                                                                                                                           koala

The screenshot of program along with its output is attached.

You might be interested in
Computers can accomplish many tasks today, but there are still some things they cannot do. Think of some of the things you would
postnew [5]
Record our dream.
Since it is from the future and advanced, it is invalid to argue back that the wish to record our dreams cannot be fulfilled.

From here you can elaborate more ...
7 0
3 years ago
Address Resolution Protocol (ARP) is a protocol for mapping an IP address to a physical machine address that is recognized in th
Nimfa-mama [501]

Answer: Switch

Explanation: ARP spoofing is a illegal harmful activity in a disguised manner by a person who tries to send the ARP (Address resolution protocol)request.The disguised ARP request is sent to steal the confidential data by the overloading of the switch because of the numerous amount of the ARP request. This attack is done in the local area network .Therefore, the correct option is switch.

6 0
3 years ago
If you touch a downed powerline covered or bare, what's the likely outcome
ANEK [815]

you would be shocked, it can even kill you

5 0
3 years ago
this device can be used to type documents,send email,browse the internet,handle the spreadsheets,do presentations,play games,and
yanalaym [24]

Answer:

im pretty a computer

Explanation:

A computer is an electronic device that manipulates information, or data. It has the ability to store, retrieve, and process data. You may already know that you can use a computer to type documents, send email, play games, and browse the Web.

3 0
3 years ago
What network information do attackers initially try to find?
kolbaska11 [484]
Attackers will initially attempt to find an IP address within the network that can be used to stage an attack. Hope this helps!
8 0
3 years ago
Other questions:
  • The technical relationship between inputs and outputs, which is needed to understand the difference between the short run and th
    5·1 answer
  • What is the best software for game design
    6·2 answers
  • The term drive app is used to describe applications stored on a computer true or false
    11·2 answers
  • With arbitrary code execution, the ________________ launches ("spawns") a command shell from which instructions can then be issu
    11·1 answer
  • 1. Print out the string length of s1 2. Loop through characters in s2 with charAt() and display reversed string 3. Compare s2, s
    6·1 answer
  • PLEASE HELP ME ASAP!!! THIS IS DUE SOON!!
    9·1 answer
  • 2. What is a cap? (0.5 points)
    9·1 answer
  • Given an int variable n that has been initialized to a positive value and, in addition, int variables k and total that have alre
    6·1 answer
  • If you were looking for a record in a very large database and you knew the ID number, which of the following would be the most d
    6·1 answer
  • The Windows Net use command is a quick way to discover any shared resources on a computer or server. True or False
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!