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
The ability of a person booking a flight on Southwest's website to reserve a car from Dollar Rent-A-Car without having to leave
katen-ka-za [31]

Answer:

Web Services

Explanation:

<em>Web Services</em>  is a technology that uses a set of protocols and protocols that serve to exchange data between applications. Different software applications developed in different programming languages, and executed on any platform, can use web services to exchange data on computer networks such as the Internet. Interoperability is achieved through the adoption of open openings.

5 0
4 years ago
D. The 7-bit ASCII code for the character '&amp;' is:
insens350 [35]

Answer:

00100110

a and d are invalid sequences because they contain an even number of 1's.

Explanation:

Odd parity means that you want an odd number of 1's in the resulting set of bits. Since there are 3 (=odd) bits in the set, a zero must be added to keep the total odd.

6 0
4 years ago
Robin has four copies of her midterm paper saved to a single folder on her
podryga [215]

Answer:

d

Explanation:

i took the test

6 0
3 years ago
The address space 0x0000-0x3FF is assigned to I/O peripherals of a given HCS12 chip. How many K bytes is this? (Points : 2) 2K
UNO [17]

Answer:

D. 1K

Explanation:

The address space 0x0000-0x3FF is of 1KB(One Kilo Byte) since 0x3ff is equal to 1023. therefore 1023=1 KB.

bitwise 0x3ff zeros out the top bits of the number such that the result is always between 0 and 1023. It is essentially the same thing as modulo( num,1024) for positive  values of num.

Hence the answer is D 1K

3 0
3 years ago
A unique aspect of Java that allows code compiled on one machine to be executed on a machine of a different hardware platform is
notka56 [123]

Answer:

Java's bytecode

Explanation:

To execute its operations, java programming languages uses bytecodes.

These bytecodes are literally instructions of a java virtual machine (or JVM). They are generated in form of a class file as soon as the java program is ran and executed. In other words, the java compiler compiles the code and generates the bytecode.

As soon as the bytecode is generated, it can be transferred to a different machine and platform completely and one can run this bytecode on this different machine.

8 0
3 years ago
Other questions:
  • How many bits do you need to count up to 30 help please
    14·1 answer
  • An information system report is an example of...
    13·1 answer
  • A license plate consists of 2 letters followed by 1 digit. How many license plates are possible if the first letter can be any l
    13·1 answer
  • Please I need this answer now.<br>this is the fill in the blanks​
    14·1 answer
  • Quality of service (QoS) is a technology that allows a network design to strategically optimize network performance for select t
    8·2 answers
  • What is the default layout position for images added to a Word 2016 document?
    8·1 answer
  • Easy coding question, please help.
    13·1 answer
  • What is malware? a type of virus that spreads through a network connection a type of virus that targets programs and files any p
    8·1 answer
  • Mike gets along with his co-workers and is always helpful to the clients. He demonstrates good _____.
    7·2 answers
  • Based on the information in the table, which of the following tasks is likely to take the longest amount of time when scaled up
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!