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
Nimfa-mama [501]
3 years ago
9

Will the Python code below print something? And will it terminate?

Computers and Technology
1 answer:
77julia77 [94]3 years ago
3 0

Answer:

Yes and Yes

Explanation:

When programs are written without indentation; it becomes a problem to read;

I'll rewrite your program as follows:

<em>def print_n(s, n):  </em>

<em>    if n > 0:  </em>

<em>        print(s)  </em>

<em>        print_n(s, n-1)  </em>

<em>    return n  </em>

<em>n = 3  </em>

<em>while print_n("hi", n):  </em>

<em>    print_n("there!", n)  </em>

<em>    n = 0</em>

<em />

Using the above as a point of reference,

Yes, the program will run and Yes, it'll terminate;

Because n is initialized to 3 at line 6 (where the main starts);

The following is passed to the function; s = "hi" and n=3

This prints "hi", three times

s = "there" and n=3 is then passed to the function print_n, afterwards;

The function then prints "there" three times

Then, the program terminates

You might be interested in
What is the encryption cipher that was the precursor to des??
Elanso [62]
DES works by using the same key to encrypt and decrypt a message, so both the sender and the receiver must know and use the same private key. Once the go-to, symmetric-key algorithm for the encryption of electronic data, DES has been superseded by the more secure Advanced Encryption Standard (AES) algorithm.
8 0
3 years ago
____ storage is not recommended for long-term archiving because the storage media can degrade over time
Lunna [17]

Hard Drive is not recommended for long-term archiving because the storage media can degrade over time,

<h3>What type of storage is recommended for long term data retention?</h3>

The long method used to long-term retention is the use of cloud. Cloud-based are known to be a form of cold storage that is made up of intelligent storage software.

Note that Hard Drive is not a long term kind of storage in the above context and as such, PE storage is not recommended for long-term archiving because the storage media can degrade over time,

Learn more about storage from

brainly.com/question/1317328

#SPJ1

5 0
2 years ago
What type of product does amd manufacture
Vitek1552 [10]
AMD makes CPUs, GPUs, Motherboards, Graphics Cards and other computer hardware
6 0
3 years ago
What is the purpose of a email
jasenka [17]

Answer:

An email is a digital message sent electronically from one computer to one or more other computers. Emails are flexible and can be used for giving instructions, serving as documentation, providing confirmation, communicating rules and procedures, making recommendations, providing a status update, making an inquiry.

7 0
4 years ago
Read 2 more answers
Your employer's right to electronically monitor you is an issue of ____.
Cloud [144]

Answer: Employee privacy

Explanation:

 Employers can electronically monitor property, computer and electronic devices under the their rights in the organization but there is issue of employee privacy. As, employee has the right to privacy in the organization or workplace.

In some organization phones and email address are provided by the company so that they can electronically monitor the employee properly. In this case, some employee feel that monitoring is the violation of their personal  and privacy rights.

8 0
3 years ago
Other questions:
  • Consider the following classes: public class Vehicle {...} public class Car extends Vehicle {...} public class SUV extends Car {
    8·1 answer
  • Jenny is the project manager and her company. She needs to break her current project into parts that her employees can work on.
    10·1 answer
  • Robert's employer has agreed to pay half the tuition for Robert to complete his college degree. This benefit is known as what?
    7·2 answers
  • Technologies can offer safety and protection for people
    11·1 answer
  • Cnt115-02* which of the following is a private ip address and can't be routed across the internet?
    12·1 answer
  • Diverting an attacker from accessing critical systems, collecting information about the attacker's activity and encouraging the
    8·1 answer
  • Identify the following​
    9·1 answer
  • Assume that students in a course are required to produce a written report on an ICT-related
    14·1 answer
  • What is are the most efficient ways to make a slide presentation?
    12·2 answers
  • Jason is the motion picture projectionist at the local IMAX theater. This means that he runs the huge movie projector so that cu
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!