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
IP ______ occurs when an intruder computer fools a network into believing its IP address is associated with a trusted source.
Veseljchak [2.6K]

Answer:

Spoofing

Explanation:

Spoofing that occurs when an intruder computer fools network into believing its IP address is associated with trusted source

5 0
2 years ago
A company has two geographically separate locations that need to connect using a VPN. Which of the following devices must be spe
victus00 [196]

Answer:

The correct answer to the following question will be Option A (Firewall).

Explanation:

  • A network or information system of safety that relies on predetermined security rules that monitors and commands outbound traffic of network or it will be configured specifically to allow VPN to enter the network
  • This usually creates a firewall between a trustworthy internal network, such as the Internet, and the untrustworthy outside network.

The other solutions like B, C and D are not capable of allowing VPN to traffic to a network. Therefore, the correct answer is Option A.

3 0
3 years ago
TV show information can either keep track of the number of viewers per show or the name of a show. Information is kept in a file
Elza [17]

Answer:

See explaination for Program source code.

Explanation:

The program source code below.

#include <iostream>

#include <fstream>

#include <vector>

using namespace std;

class Show

{

private:

string title;

int viewers;

public:

Show()

{

this->title = "";

this->viewers = 0;

}

Show(string title, int viewers)

{

this->title = title;

this->viewers = viewers;

}

string getTitle(){ return this->title; }

int getViewers(){ return this->viewers; }

};

int main()

{

vector<Show> shows;

vector<string> titles;

vector<int> viewers;

ifstream inFile1("file1.txt");

ifstream inFile2("file2.txt");

string line1, line2;

if(!inFile1.is_open() || !inFile2.is_open())

{

cout << "Either of the files could not be found!\n";

exit(0);

}

getline(inFile1, line1);

if(line1.compare("Show") == 0)

{

while(getline(inFile1, line1))

{

titles.push_back(line1);

}

inFile1.close();

}

getline(inFile2, line2);

if(line2.compare("Viewer") == 0)

{

while(getline(inFile2, line2))

{

viewers.push_back(stod(line2));

}

inFile2.close();

}

for(int i = 0; i < titles.size(); i++)

{

shows.push_back(Show(titles[i], viewers[i]));

}

// display all the show details

cout << "\nALL SHOWS:\n----------\n";

for(Show show : shows)

{

cout << "Title: " << show.getTitle() << ", Number of viewers: " << show.getViewers() << endl;

}

cout << endl;

return 0;

}

See attachment for output

3 0
3 years ago
Which of the following are considered transactions in an information system?
Marrrta [24]

Answer: (C) All of them.

Explanation:

 All the given options are example of the transaction in the information system.

As, the money deposited in the bank account is the process that take place computerized for transaction purpose. Now a days we can easily done transaction through wire transfer at anywhere and anytime by using the information system technology.  

Students can easily study online and also record their answers in the online test by using the information system technology.  

Customers can also doing shopping online by adding various products and items in the online shopping cart by using various e-commerce websites like amazon, flip-cart etc.  

5 0
3 years ago
Hisoka is creating a summary document for new employees about their options for different mobile devices. One part of his report
algol13

Hisoka would not include in his document that is Apple users file-based encryption to offer a higher level of security.

<h3>Does Apple use the file based encryption?</h3>

It is said that iOS and iPad OS devices are known to often use a file encryption system known to be Data Protection.

Therefore,  Hisoka would not include in his document that is Apple users file-based encryption to offer a higher level of security.

Hence option A is correct.

Learn more about encryption from

brainly.com/question/9979590

#SPJ1

3 0
2 years ago
Other questions:
  • Holly would like to run an annual major disaster recovery test that is as thorough and realistic as possible. She also wants to
    5·1 answer
  • The icons to insert footnotes and endnotes in a document are located in the _____ tab.
    8·1 answer
  • (Palindrome integer) Write the methods with the following headers // Return the reversal of an integer, i.e., reverse(456) retur
    9·1 answer
  • Describe how data center storage applications drive the development of SAN technology.
    8·1 answer
  • Alguien me puede ayudar a arreglar mis auriculares que mi perro rompió en el conector
    5·1 answer
  • Laura is filming a scene in which the subject is sitting with a lit fireplace behind him. The only other source of light in the
    15·1 answer
  • Instruction: Decide what the total marketing budget will be, and make a list of at least four things you will spend money on and
    15·1 answer
  • How do you create a CA file? short answer
    8·1 answer
  • When a computer is infected by a virus, _______.
    14·1 answer
  • Create a program that prompts the user for a positive integer then prints a right-aligned pyramid using that number using the st
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!