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
The cord of a bow string drill was used for
goldfiish [28.3K]

Answer:

I don't remember much on this stuff but I think it was B

5 0
3 years ago
Repeated execution of a set of programming statements is called repetitive execution.
Korolek [52]

Answer:

False

Explanation:

6 0
3 years ago
Which of the following is true of functions?
Anna11 [10]

Answer:

the answer is D

Explanation:

4 0
3 years ago
how many usable host addresses are available for each subnet when 4 bits are borrowed from a class C IP address
jonny [76]

Answer:

The answer is "14".

Explanation:

Let the IP address = 196.45.204.0

When it borrowed 4 bits

\therefore\\\\ subnet = 28

IP=  \frac{196.45.204.0}{28}\\\\ 28 \to 11111111.11111111.11111111.11110000

If the borrowed bits are left out then:

The Number of useable host addresses:

= {(2^4) - 2} \\\\ = 16-2\\\\ =14

3 0
3 years ago
What happens when you press Ctrl Alt Delete twice?
Iteru [2.4K]
The same thing as if you do it once
6 0
3 years ago
Other questions:
  • Judy forgot where she saved a certain file on her computer. Therefor, she searches for all files with a jpg file extension. Whic
    11·2 answers
  • This program will output a right triangle based on user specified height triangle_height and symbol triangle_char. (1) The given
    9·1 answer
  • A top-notch IT company is seeking an experienced leader to direct a team of experts in the development, creation, and modificati
    14·2 answers
  • This library function returns a random floating point number within a specified range of values. The function returns a random f
    12·1 answer
  • On laptops with a smart card reader installed, where is the smart card reader usually located?
    13·1 answer
  • Design and implement an application that reads a sequence of up to 25 pairs of names and postal (ZIP) codes for individuals. Sto
    9·1 answer
  • If you were setting up a network with 100 nodes and you wanted no more than 25 nodes per segment: what devices and connections w
    9·1 answer
  • Syntax errors ________. a. result from an attempt to perform an operation that cannot executeb. are errors such as misspelled ke
    14·1 answer
  • Calvin needs to design a simple yet professional interface for his users. Which option should he implement?
    9·2 answers
  • Complete the sentence with the correct response.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!