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
tangare [24]
3 years ago
7

Write a function called is_present that takes in two parameters: an integer and a list of integers (NOTE that the first paramete

r should be the integer and the second parameter should be the list) and returns True if the integer is present in the list and returns False if the integer is not present in the list. You can pick everything about the parameter name and how you write the body of the function, but it must be called is_present. The code challenge will call your is_present function with many inputs and check that it behaves correctly on all of them. The code to read in the inputs from the user and to print the output is already written in the backend. Your task is to only write the is_present function.
Computers and Technology
1 answer:
Agata [3.3K]3 years ago
7 0

Answer:

The function in python is as follows

def is_present(num,list):

    stat = False

    if num in list:

         stat = True

       

    return bool(stat)

Explanation:

This defines the function

def is_present(num,list):

This initializes a boolean variable to false

    stat = False

If the integer number is present in the list

    if num in list:

This boolean variable is updated to true

         stat = True

This returns true or false        

    return bool(stat)

You might be interested in
Which is an action that an operating system performs? (1 point)
Darya [45]

The  action that an operating system performs is that it facilitates a computer's basic functions between hardware and software.

<h3>What is the purpose of an operating system in a computer?</h3>

An operating system (OS) is known to be a term that is used in computing and it is said to be one which the program, after being started  is said to be loaded into the computer using the boot program.

It is one that helps to handle all of the other application programs in a computer.

The application programs is known to also make use of the operating system and as such, The  action that an operating system performs is that it facilitates a computer's basic functions between hardware and software.

Learn more about operating system from

brainly.com/question/22811693

#SPJ1

8 0
2 years ago
Type the correct answer in the box. Spell all words correctly. What is the default margin width on all four sides of a document?
Sergeu [11.5K]

1 inch (2.54 cm

the default top and bottom margins were 1 inch (2.54 cm), but 1.25 inches (3.17 cm) were given at the left and the right.

That's standard for document size by default.

7 0
3 years ago
What is one way hackers can trick you into transmitting personal data over on a public network without your knowledge
Bumek [7]
Hmmm when they say that we have a debt of $10,000 but you don't but you don't know that so they ask you for the personal data for your bank so their can get in and get the money for you so you don't have to and that how they trick you
4 0
2 years ago
How do you know what memory to purchase for your computer?
Contact [7]
Just look for your computer model number and if not then it should be on the ram itself.
7 0
4 years ago
1. What is a database?
DENIUS [597]

Answer:

<h2>1. In computing , a database is a organization collection of data </h2><h2>stored at accessed electronically from a computer system .</h2>

5 0
3 years ago
Other questions:
  • The order in which statements are executed during a program run. Answer 1 The first part of a compound statement begins with a k
    12·1 answer
  • If you delete a sent message on gmail does the person still get it
    14·1 answer
  • What will be the output of “AAAAMMMMMHHHVV” using a file compression technique?
    10·1 answer
  • Tortise and hare race java g Modify the main class so it runs the race 100 times and reports how many times each runner wins. (T
    7·1 answer
  • The marketplace for computer hardware:________ 1. has become increasingly concentrated in top firms 2. has expanded to include a
    5·2 answers
  • Does anyone know the answer for this? I’m extremely confused.
    8·2 answers
  • Write a program called array1.cpp file that use either regular for loop or range based for loop to display the contents of the a
    14·1 answer
  • Where are methods listed in a UML class diagram showing three parts?
    8·1 answer
  • Who plays oblox .............................
    8·2 answers
  • assuming the default gateway is connected to the internet, what type of internet access would this server have?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!