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
The following program contains 6 errors. Correct the errors and submit a working version of the program. The corrected version o
Nikitich [7]

Answer:

public class Oops6

{

public static void main(String[] args) throws FileNotFoundException

{

Scanner in = new Scanner(new File("example.txt"));

countWords(in);

}

<u><em>// Count the number of times "line" is entered</em></u>

public static void countWords(Scanner input)

{

int lineCount = 0;

int wordCount = 0;

while (input.hasNextLine())

{

<u><em>// reads one line at a time in the loop</em></u>                                                    String line = input.nextLine();

lineCount++;

while (input.hasNext()) { // tokens in line

String word=input.next();

wordCount++;

                     }

}

System.out.println("Lines: " + 5);

System.out.println("Words: " + 21);

}

}

8 0
4 years ago
Explain the role of ICT in banks​
vladimir1956 [14]

Answer: ICT help banks improve the efficiency and effectiveness of services offered to customers, and enhances business processes, managerial decision making, and workgroup collaborations, which strengthens their competitive positions in rapidly changing and emerging economies.

Explanation: please give branliest I only need one more to make ace

7 0
3 years ago
What are the different components of the cloud architecture?
sashaice [31]

Cloud computing architecture can be described as components and subcomponents required for cloud computing. Typically, these components consist of front (fat client, mobile device, thin client) and black end platforms (storage, servers), a cloud based delivery, and a network (Internet, Internet, Cloud). When all of these components are combined, they make up a cloud architecture.

3 0
3 years ago
If you can't brake to avoid a hazard, you should _____. A. engage your antilock braking system B. accelerate immediately instead
zzz [600]

Answer :  A. Engage your anti lock braking system

Explanation:

If you encounter a situation where you are not able to avoid the hazard then you should engage your anti-lock braking system because anti-lock braking system helps you steer safely by restoring traction to your tires. It helps prevent wheels locking up allowing driver to steer safely.

If you accelerate immediately or set the wheel to cruise control then probability of accident increases. In an attempt to steer around, chances of accident are also more.

8 0
3 years ago
Read 2 more answers
Think about the ways new communication technologies can make certain tasks easier for
Andru [333]
Technology gives them the ability to do things that they normally couldn’t do. Like deaf people could get a cochlear implant to make them hear, people without a leg can get a prothetic leg to help them walk. Even something as simple of being colorblind, there are glasses to help them see color. It’s amazing.
3 0
3 years ago
Other questions:
  • 1. Which markup language adds the ability to use video without requiring the user to download add-ons?
    13·1 answer
  • If you are trying to create a web page for your band and having difficulty creating links to other groups on your page, what is
    7·1 answer
  • The elements of an integer-valued array can be set to 0 (i.e., the array can be cleared) recursively as follows: An array of siz
    8·1 answer
  • You have successfully compiled the file Hi.java, how do you run the corresponding program from the command line?
    7·1 answer
  • Which property of a DBMS lets you change the database structure without requiring you to change the programs that access the dat
    10·1 answer
  • While approaching your parked car, the first step before getting in should be
    9·2 answers
  • Name the following hardware device to write the data from hard disk to CD ​
    13·1 answer
  • The following characteristics are common to the majority of cloud environments, except: 1. on-demand usage 2. resiliency measure
    12·1 answer
  • Any action that causes harm to your computer is called a
    15·1 answer
  • Discuss the purpose purpose of of network attached storage devices
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!