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
Aliun [14]
3 years ago
14

Create a function named test2Problem2that contains a list comprehension. This function will take asingle integer parameter nand

returns a list of length n of every other prime. (Please note that primes start at 2.)There will be a 10 point deduction for not using a list comprehension to solve this problem.List comprehensions have this form: [ expression for item in list if conditional ]In:10Out:[2,5,11,17,23,31,41,47,59,67]In:7Out:[2,5,11,17,23,31,41]
Computers and Technology
1 answer:
ikadub [295]3 years ago
3 0

Answer:

C++.

Explanation:

#include <iostream>

using namespace std;

/////////////////////////////////////////////////////////

void printPrime(int n) {

   if (n > 0) {

       cout<<"[2";

       for (int i=3; i<=n; i++) {

           bool isPrime = true;

           

           for (int j=2; j<i; j++) {

               if (i % j == 0) {

                   isPrime = false;

                   break;

               }

           }

           

           if (isPrime == true)

               cout<<", "<<i;

       }

   }

   else {

       cout<<"Invalid input";

   }

   cout<<"]";

}

/////////////////////////////////////////////////////////

int main() {

   int n;

   cout<<"Enter positive integer: ";

   cin>>n;

   printPrime(n);

   return 0;

}

You might be interested in
Describe the major elements and issues with system prototyping​
vichka [17]

Answer:

Pic attached...

Hope it helps!!!

6 0
3 years ago
A number of LC-3 instructions have an "evaluate address" step in the instruction cycle, in which a 16-bit address is constructed
hjlf

Answer: you want to list all LC structers

Explanation:

4 0
4 years ago
Help plz
Sonbull [250]

1.

first = float(input("First Entry = "))

second = float(input("Second Entry = "))

def func(num1, num2):

   return max(num1, num2)

print(func(first, second))

2.

first = input("First Entry = ")

second = input("Second Entry = ")

def func(word1, word2):

   return sorted([word1,word2])[0]

print(func(first, second))

I hope this helps!

8 0
3 years ago
Sara wants to set up her lights to turn on when she arrives home. She has heard that she might be able to do this using IoT. Wha
iren [92.7K]

Sara should be concerned about security when setting up her loT lights.

<h3>What are loT lights?</h3>

loT light are otherwise called parking lot lights are outdoor lights that are placed on poles which are located on parking lots, pathways and driveways.

The loT light are used to provide bright light to the individuals so as to safely perform their various duties.

Therefore, Sara should be concerned about security when setting up her loT lights.

Learn more about security here:

brainly.com/question/25720881

8 0
2 years ago
Read 2 more answers
What are some options available when using the Replace feature?
3241004551 [841]

Assuming that the user is talking about Microsoft Word, the options available when using the replace feature include replace, replace all, and find next. First, the Find what and Replace with boxes locates a word or phrase and replaces it with the new text. Selecting the replace option will update one instance while the replace all option will update all instances without stopping at each one. You can click on the Find Next several times until you come to the instance that you want to update.

8 0
3 years ago
Other questions:
  • Harry is creating a presentation for a school event. He has to deliver the presentation to a huge audience. What should he keep
    14·2 answers
  • Developers work together with customers and useras to define requirements and specify what the proposed system will do. If once
    9·1 answer
  • An sObject named Application _c has a lookup relationship to another sObject named Position_c.
    12·1 answer
  • Write structured pseudocode to show the following: print “Reorder” when the quantity is less than 20; otherwise print “OK”.
    15·1 answer
  • What’s bigger 4,000,000 KB or 2.8 GB
    5·2 answers
  • What is the best temperature to set your air conditioner on?
    12·1 answer
  • Which protocol sends a request to view or download a website or file ​
    7·1 answer
  • Write an expression that executes the loop while the user enters a number greater than or equal to 0.
    9·1 answer
  • 25 POINTS PLATO
    6·2 answers
  • C#
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!