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
True or False: Unity can apply multiple textures to a single object or terrain
MaRussiya [10]
This is very true unity is what u said and it is the definition of this
3 0
3 years ago
When using a calculator be sure to press ____ first.​
matrenka [14]

Answer:

A. C to clear any previous calculations.

hope it helps...

6 0
3 years ago
Read 2 more answers
What are the benefits of public access databases like ncbi? how does?
DaniilM [7]
<span>It has public-access databases,which makes the data available for masses. It develops software tools for analyzing genome data, and disseminates biomedical information. It also houses important resource for bio-informatics tools and services. It benefits researches with quantum of data available for their specific area of research.</span>
5 0
3 years ago
What kind of image does this photograph represent?
Drupady [299]
C architecture photograph
8 0
3 years ago
Read 2 more answers
What is 1 TB equal to ?<br> . 1024 kb<br> .1024 gb <br>. 1024 pb <br>. 1024 mb​
OLEGan [10]

\large \mathfrak{Answer : }

1 TB = 1024 GB

3 0
3 years ago
Read 2 more answers
Other questions:
  • Which term is used to describe a password-protected, encrypted data file that verifies the identity of the sender of a message?
    8·1 answer
  • How do I make my own extension for chrome?
    7·1 answer
  • The energy used by an appliance which operates at 240 volts at 15 amp for 4 hr. is A. 0.92 kwhr. B. 3.45 kwhr. C. 14.4 kwhr. D.
    8·1 answer
  • While the Internet can be a great resource, the information is not always reliable, as anyone can post information. Select one:
    11·1 answer
  • Which of the following works on the pay-per-click (PPC) and cost-per-click (CPC) concept? ~ Plato
    9·1 answer
  • Pseudocode is a good choice to communicate a____of a process
    10·1 answer
  • Which character is cannot be used in a file name _ (underscore)/ (backslash)- (hyphen) % ( percent)
    12·1 answer
  • ____ 59. Suppose that x and y are int variables, ch is a char variable, and the input is: 4 2 A 12 Choose the values of x, y, an
    7·2 answers
  • Explain how to utilize the computer in rooms management.​
    13·1 answer
  • Write if true or false
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!