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
4vir4ik [10]
4 years ago
10

Write a recursive program that requests an answer to the question "Are we there yet?" using an input statement and terminates if

the user answers 'yes', but executes a recursive call if the user answers anything else (do not use any loops in this program).
Computers and Technology
1 answer:
inna [77]4 years ago
3 0

Answer:

def recursive_func():

   x = input("Are we there yet?")

   if x.casefold() == 'Yes'.casefold():

       return

   else:

       recursive_func()

recursive_func()

Explanation:

We define the required function as recursive_func().

The first line takes user input. The user input is stored in variable x.

The next line compares the user input to a string yes. The function executes the else block if the condition isn't met, that is a recursive call is executed.

IF condition returns the function. The string in variable X is compared to a string 'Yes'. the casefold() is a string function that ignores the upper/lower cases when comparing two strings. (This is important because a string 'yes' is not the same yes a string 'Yes' or 'YES'. Two equal strings means their cases and length should match).

You might be interested in
What needs to be done before depositing a check using a mobile app?
galben [10]

Answer:

The check needs to be signed in the back by you or whoever is depositing it.

7 0
2 years ago
Read 2 more answers
Modify the FitnessTracker class, created in Chapter 4 Programming Exercise 3AB, so that the default constructor calls the three-
Ivenika [448]

Answer:

Is this coding?

Explanation:

5 0
3 years ago
Why is it difficult to correctly identify a new product as emerging technology
Gekata [30.6K]
Because a lot of people post false information on websites and marketing managers (whatever they're called) will actually falsely advertise their product as using new technology.
5 0
4 years ago
Does anyone have 2.19.4 Guess a number 2.0 code for codehs?
lubasha [3.4K]

Answer:

I'm trying to create a program that will ask the user for an exam score in the range 0 to 100. ... I want to take the python course but I have not class code, anyone can help?

Explanation:

3 0
3 years ago
8. To be a Bunk Leader, a staff member must have over 4 service years and have completed leadership training. In cell L2, enter
Nitella [24]

Answer:

=IF(AND([Service Year]>4,[Leadership Training]="Yes"),"Yes","No")

Explanation:

To make use of structured references, a table has to be defined (created). Assume that the table definition is as follows;

Staff --- Service Year --- Leadership Training --- Status

In cell L2, type the above formula

Analyzing the formula:

=; An Excel formula must start with an = sign

IF; This signifies  that the formula is an "IF" function

AND; This signifies that there are more than one condition in thee formula and all conditions must be true

[Service Year]>4; The question requires that the formula uses a structured referencing. Structured referencing is such that the columns of a table are called instead of cell names;

Here, reference is being made to [Service Year] because Service Year is a column name and its value must be greater than 4

[Leadership Training]="Yes"; The above analysis is applicable here too because Leadership Training is column name and it must be "Yes" for it to return a true value.

"Yes"; Return Yes if both conditions are true

"No"; Otherwise, return No.

4 0
4 years ago
Other questions:
  • Why did LISD had to block the game “among us”?
    8·2 answers
  • Which is the responsibility of a software architect?
    11·1 answer
  • How is a computer and a iphone different
    9·1 answer
  • When should you save your document?
    15·2 answers
  • What does the CYMK tab let you do?
    5·2 answers
  • Consider the code block below. What is the value of amount when this method is called twice, the first time using cookieJar(7) a
    9·1 answer
  • The data type that can hold decimal or fractional values
    14·1 answer
  • - A blacksmith is shoeing a miser's horse. The blacksmith charges ten dollars for his work. The miser refuses to pay. "Very well
    6·1 answer
  • Differentiate the term, "bundling," as applied to a Mac/Apple computer and a PC.
    5·1 answer
  • Why are laptop employment of computer popular these days​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!