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
If the task is to write firewall specifications for the preparation of a(n) ____, the planner would note that the deliverable is
Tpy6a [65]

Answer:

RFP

Explanation:

It is the type of document that is used to ask vendors to propose the solutions of problem that are faced by customer. It is the abbreviation of "Request for Proposal". This proposal is processed though the bidding, to offer the services or submit business proposals by vendors.

4 0
3 years ago
Write a python function genRandomVect that returns a random 1d numpy array of size (50,) where each element is an integer sample
SSSSS [86.1K]

Answer:

import numpy as np

def genRandomVect():

   arr = np.random.choice(range(100),size=(50,),replace=False)

   return arr

 

print("Random 1D numpy array where each element is an integer sampled from: [0, 100) ")

print( genRandomVect() )

Explanation:

  • Create a function to create a numpy array with random integers in range[0,100) with no duplicates
  • Use the random.choice to select random values from range[0,100)  and size attribute to take the size of the required array .
  • Finally return the numpy array.

6 0
3 years ago
When purchasing a security program, you must make sure that _____. Select 2 options.
olganol [36]

Answer:

it is complex

employees are not involved

4 0
3 years ago
7) through: (0, 4) and (-1,0)​
Andreyy89

Answer:

its 5

Explanation:

7 0
3 years ago
Helppppppppppppppppppp
ddd [48]
Helpppppppppppppppppppp
3 0
3 years ago
Other questions:
  • Which elements in a web page require a visitor’s action?
    15·1 answer
  • To join two or more objects to make a larger whole is to _____________ them.
    8·2 answers
  • What test is most similar to binary​
    9·1 answer
  • Write a Python program to do the following:
    12·1 answer
  • Read the four detective reports and the combined affidavit and warrant for the M57 Patents case. Write a one- to two-page paper
    5·1 answer
  • Universal Containers maintains Job information in a Custom Object that contains sensitive information. The only users who should
    6·1 answer
  • I.d 9934607467<br> p.a.s.s 54321<br><br> P.L.E.A.S.E J.O.I.N. Z.O.0.M. M.E.E.T.I.N.G
    10·1 answer
  • Please help What two Boolean operators can you use to narrow your search results?
    7·1 answer
  • Which of the following describe audio-editing software? Choose all that apply.
    5·2 answers
  • A relational database contains a series of _____ that can be connected to form relationships.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!