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
Naya [18.7K]
3 years ago
5

Selector

Computers and Technology
1 answer:
ASHA 777 [7]3 years ago
4 0

Answer:

See explaination

Explanation:

# Import required the module.

import random

# Define a function selector() which accepts the

# input_list, check_list, and return_list and

# returns a string named output.

def selector(input_list,check_list,return_list):

# Assign None to string variable output.

output=None

# Use for loop to traverse through input_list.

for i in range(len(input_list)):

# Check if element of an input_list is present

# in check_list.

if input_list[i] in check_list:

# Assign a random value from return_list

# to output.

output=random.choice(return_list)

# break out of the loop if input_list

# element is present in check_list.

break

#

return output

# Use assert statement to test a condition.

# If the condition is true, then program continues to

# execute, otherwise raises an AssertionError.

assert callable(selector)

assert selector(['is','in','of'],['of'], ['Yes']) == 'Yes'

assert selector(['is','in'],['of'], ['Yes','No']) == None

# Display the output.

print(selector(['is','in','of'],['of'], ['Yes']))

print(selector(['is','in'],['of'], ['Yes','No']))

You might be interested in
What is the final amount stored in value if the computer selects 17 as the
nadya68 [22]

Answer: -17

Explanation:

Our random number is 17. Let's go through line by line.

  1. value is a random number picked which is 17
  2. valueB = 17 / 2 = 8.5
  3. If value is greater than 0 AND value has a remainder of 1, we will set the value to value* -1.
  4. Value is now 17 * -1 = -17

Let's quickly calculate value mod 2. 17 % 2 = is 1. If you're wondering how we did that, the remainder after dividing 8 into 17 twice is 1, because 17 - 16 = 1.

We stop after line 4 because we stop the conditional statement after one condition is filled.

6 0
3 years ago
We all interact with various information systems every day: at the grocery store, at work, at school, even in our cars (at least
Serhud [2]

Explanation:

An information system can be defined as an automated system or not, which is used for the purpose of collecting data and transforming it into relevant information for a given purpose.

Currently, information systems are increasingly used in the organizational environment, for example, as management information systems and decision support systems, which are automated computer systems that provide greater support to a manager's work, due to the amount of data that store and process relevant information to assist in the speed of the decision-making process, since information systems are able to capture a volume of data and analyze it, create standards, find flaws and transmit essential information that makes the manager's work more facilitated and improved.

8 0
3 years ago
PLEASSEE HELP ILL GIVE U A BRAINLIEST IF UR RIGHT!!
Nana76 [90]
It is digital signal 
5 0
3 years ago
Read 2 more answers
Under which menu option of a word processing program does a callout appear?
Juli2301 [7.4K]
A callout is a type of text box that also includes a line for pointing to any location on the document. A callout appears under the SHAPES <span>menu of the word processing program. The answer that completes this statement is the word "shapes". Hope this answers your question. </span>
7 0
3 years ago
You maintain an RODC running Windows Server 2012 R2 at a branch office, and you want Juanita, who has solid computer knowledge,
ludmilkaskok [199]

Answer:

Make Juanita's account  a delegated admin in the RODC's computer.

Explanation:

Making Juanita an administrator on the RODC's computer will confer on her higher privileges than a regular user. As an admin, she will be able to make changes on the computer, carry out tasks like updates on drivers and software, and change security settings, access all files and folders, manage other user accounts and entire management of the computer since she has the necessary skills and knowledge.

5 0
3 years ago
Other questions:
  • Mail merge can be used in business to complete which of the following tasks
    15·2 answers
  • A ________ is a set of rules that governs data communication.
    14·1 answer
  • What ip address cidrs are not allowed to be communicated with by our malware?
    15·1 answer
  • "what type of index has an index key value that points to a data row, which contains the key value? "
    9·1 answer
  • Select the correct answer.
    10·1 answer
  • (20points)
    6·1 answer
  • For a company, intellectual property is _______________.
    5·2 answers
  • What are building blocks? Select three options.
    14·1 answer
  • What microphone is this
    8·1 answer
  • The Backstage view is where you can see information and options pertaining to the user account and settings. How is the Backstag
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!