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 can you add to your presentation from the insert ribbon toolba?
stiks02 [169]

Answer:

anything you want

Explanation:

there are a lot of adons for powerpoint

7 0
3 years ago
I need help 40 points and brainless
marta [7]

Answer:

the answer is 50

Explanation:

hope that helped

3 0
3 years ago
Two of the people most often credited with the invention of the Internet and WWW respectively are _____.
krek1111 [17]
Bob Kahn and Vint Cerf were both pioneers of the Internet, and Tim Berners-Lee was known for inventing the WWW.
7 0
4 years ago
What is indentation?​
Vlad1618 [11]

Answer: may refer to: Indentation (typesetting), the placement of text farther to the right, or left, to separate it from surrounding text. Indentation style, in programming a convention governing the indentation of blocks of code to convey the program's structure.

Explanation:

5 0
3 years ago
What authentication protocol is ticket-based and is used by windows computers that are members of an active directory domain?
Temka [501]
Your IP address, also known as Internet Protocol
7 0
4 years ago
Other questions:
  • Joanna accidentally leaned on her keyboard and repeatedly typed the letter z. How can she fix this mistake?
    6·2 answers
  • What happens to weather patterns when a cold front approaches? What happens to
    14·1 answer
  • True false) ther are five arrow keys on the keborad​
    9·1 answer
  • The work day has just started and you receive reports that the inventory management server is not accessible on your company's n
    7·1 answer
  • Below is a recursive implementation of the factorial function. For what value of n will this function not produce the desired re
    8·1 answer
  • A computer program uses 3 bits to represent integers. When the program adds the decimal (base 10) numbers 5 and 3, the result is
    6·1 answer
  • When more open-ended questions are asked in a study group, discussions are more likely to
    14·2 answers
  • PLzzzzzz help me!! I will mark brainiest to the one who answers it right!!
    14·1 answer
  • Explain external interface bus
    7·1 answer
  • Int r=6;<br> int v=20;<br> System.out.println( r % v );
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!