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
xenn [34]
3 years ago
7

Assume the availability of a function is_prime. Assume a variable n has been associated with positive integer. Write the stateme

nts needed to find out how many prime numbers (starting with 2 and going in increasing order with successively higher primes [2,3,5,7,11,13,...]) can be added before exceeding n. Associate this number with the variable k. SUBMIT
Computers and Technology
1 answer:
My name is Ann [436]3 years ago
5 0

Answer:

def main():

   # Accept data from the user

   n=int(input('Enter the value of n:'))

   k=2;

   sum=0

   print('The list of the prime numbers are as follows:')

   # This loop runs from k to n

   while k<=n:

       # Call is_prime() method,

       # to check whether k is a prime or not

       sum=sum+is_prime(k)

       k=k+1

   print('Sum of the prime numbers:',sum)

# is_prime() Method

def is_prime(k):

   prime=0        

   i=1

   # Check k is a prime or not

   while i<=int(k):

       # Find the factors of k

       if (k % i) == 0:

           prime=prime+1

       i=i+1

   # If k as two factors

   if(prime==2):        

       print(k)

       return k;

   # If k as more than two factors

   else:        

       return 0;

# Call the main() method

main()

Explanation:

You might be interested in
. A wireless ……..is a device used to resolvewireless network connectivity problems.
Setler [38]

Answer:LAN adapter

Explanation:

LAN adapter is use to connect a computer to the network in an local area network. The connection is possible via a modem or a router which helps to reduce the wireless connectivity problem.

4 0
3 years ago
Describe the benefits of digital technology. Eric reads interesting information about MP3 players and wants to buy one. Which of
Otrada [13]

Answer:

b. Play music

Explanation:

Digital technology helps improve an existing process and makes things better. In this scenario of an MP3 player, digital technology takes care of music. Before a portable MP3 player came into the picture, people had to carry large physical records or multiple CD packs but now, a small device can hold thousands of those same songs in it.

4 0
3 years ago
To arrange data in alphabetical order quickly, you can _____ the data.
Vadim26 [7]
A. Organizing the data makes it easier to to arrange anything.
7 0
3 years ago
Read 2 more answers
Photoshop express is an application that you download to your computer and has a nominal fee of 19.99 for educational use only.
olasank [31]

Photoshop express is a very effective tool for editing images. I use Adobe Photoshop CC and its amazing :)

7 0
4 years ago
Read 2 more answers
Full detail about computer and its history<br><br><br>​
tensa zangetsu [6.8K]

Answer:

The computer as we know it today had its beginning with a 19th century English mathematics professor name Charles Babbage. He designed the Analytical Engine and it was this design that the basic framework of the computers of today are based on. ... It was called the Atanasoff-Berry Computer (ABC).

Explanation:

5 0
3 years ago
Other questions:
  • Anyone have good websites to cure boredom
    10·2 answers
  • A cell has an unlimited number of conditions for Conditional Formatting.<br> A.true<br> B.false
    7·1 answer
  • Which of the following is an example of a currency Number format in Excel?
    9·1 answer
  • Assume that the following table is created and stored in your database:
    5·1 answer
  • The Hydrosphere contains (4 points)
    10·1 answer
  • Manuel is recording a macro and made a mistake. What is the best option for addressing this situation? O Pause and rewind the ma
    11·2 answers
  • What are the benefits of computer literacy?
    10·1 answer
  • Enlist the advantages of data consolidation in a spreadsheet
    10·1 answer
  • Write measure five safety measures can be taken to stay safe in social media​
    9·2 answers
  • Which two cisco products are equipped with the integrated connector to the cisco cws service? (choose two. )
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!